From 5eae81a59f84596e09ee6f8859a110f9246e8e58 Mon Sep 17 00:00:00 2001 From: Patrick <38922528+diddip21@users.noreply.github.com> Date: Tue, 4 May 2021 20:17:25 +0200 Subject: [PATCH] zamba.conf variable validation checking LXC_TIMEZONE and LXC_*_STORAGE variable if Storage/Timezone exists --- install.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/install.sh b/install.sh index 4a20bbf..e8713f9 100644 --- a/install.sh +++ b/install.sh @@ -23,6 +23,21 @@ LXC_MP="0" LXC_UNPRIVILEGED="1" LXC_NESTING="0" +# Check config Settings +if [[ $LXC_TIMEZONE != $(timedatectl list-timezones | grep $LXC_TIMEZONE) ]]; then + echo "Unknown LXC_TIMEZONE setting (list available Timezones 'timedatectl list-timezones')"; exit 0 +fi +if [[ $LXC_TEMPLATE_STORAGE != $(pvesh get storage --noborder --noheader | grep $LXC_TEMPLATE_STORAGE$) ]]; then + echo "Unknown LXC_TEMPLATE_STORAGE, please check your storage name"; exit 0 +fi +if [[ $LXC_ROOTFS_STORAGE != $(pvesh get storage --noborder --noheader | grep $LXC_ROOTFS_STORAGE$) ]]; then + echo "Unknown LXC_ROOTFS_STORAGE, please check your storage name"; exit 0 +fi +if [[ $LXC_SHAREFS_STORAGE != $(pvesh get storage --noborder --noheader | grep $LXC_SHAREFS_STORAGE$) ]]; then + echo "Unknown LXC_SHAREFS_STORAGE, please check your storage name"; exit 0 +fi + + select opt in zmb-standalone zmb-ad zmb-member mailpiler matrix debian-unpriv debian-priv quit; do case $opt in debian-unpriv)