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