From 8659f2c25294380f95d3040b92e212a75a735af1 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Sun, 26 Apr 2020 17:56:13 +0200 Subject: [PATCH] Fixes for recent changes (#87) * some fixes * set fixes * some rest * add shellcheck ignore and explaination * fix iocage install dir not being exported * reset branch to dev --- config.yml.example | 35 +++++++++++++++++++++++++++++++++++ global.sh | 12 ++++++------ jailman.sh | 2 ++ 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/config.yml.example b/config.yml.example index 50b4b9a8..81372f11 100644 --- a/config.yml.example +++ b/config.yml.example @@ -28,8 +28,43 @@ example: example pkgs: mono plex: plex + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 beta: false +lidarr: lidarr + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +sonarr: sonarr + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +radarr: radarr + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +kms: kms + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +jackett: jackett + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +organizr: organizr + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +tautulli: tautulli + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + +transmission: transmission + ip4_addr: 192.168.1.99/24 + gateway: 192.168.1.1 + + nextcloud: nextcloud ip4_addr: 192.168.1.99/24 gateway: 192.168.1.1 diff --git a/global.sh b/global.sh index d9d7a9eb..4a9f1359 100755 --- a/global.sh +++ b/global.sh @@ -3,15 +3,15 @@ # yml Parser function # Based on https://gist.github.com/pkuczynski/8665367 -# shellcheck disable=SC2086 +# +# This function is very picky and complex. Ignore with shellcheck for now. +# shellcheck disable=SC2086,SC2155 parse_yaml() { - prefix=${2} - s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') - local prefix - local s w fs + local prefix=${2} + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" "${1}" | - awk -F"${fs}" '{ + awk -F$fs '{ indent = length($1)/2; vname[indent] = $2; for (i in vname) {if (i > indent) {delete vname[i]}} diff --git a/jailman.sh b/jailman.sh index 49465707..2111951f 100755 --- a/jailman.sh +++ b/jailman.sh @@ -100,8 +100,10 @@ while getopts ":i:r:u:d:g:h" opt esac done +# auto detect iocage install location global_dataset_iocage=$(zfs get -H -o value mountpoint $(iocage get -p)/iocage) global_dataset_iocage=${global_dataset_iocage#/mnt/} +export global_dataset_iocage # Parse the Config YAML # shellcheck disable=SC2046