#1253 support cancel

This commit is contained in:
rootzoll 2020-06-23 20:56:32 +02:00
parent f34a049ee3
commit 9c81c612f9
2 changed files with 11 additions and 3 deletions

View File

@ -390,8 +390,16 @@ if [ ${check} -eq 1 ]; then choice="on"; fi
if [ "${zerotier}" != "${choice}" ]; then
echo "zerotier setting changed .."
anychange=1
sudo -u admin /home/admin/config.scripts/bonus.zerotier.sh ${choice}
dialog --msgbox "ZeroTier is now ${choice}." 5 46
error=""
source <(sudo -u admin /home/admin/config.scripts/bonus.zerotier.sh ${choice})
if [ ${#error} -eq 0 ]; then
dialog --msgbox "ZeroTier is now ${choice}." 5 46
else
if [ "${error}" != "cancel" ]; then
dialog --msgbox "ZeroTier Error:\n${error}" 5 46
fi
fi
else
echo "ZeroTier setting unchanged."
fi

View File

@ -47,7 +47,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
networkID=$(whiptail --inputbox "\nPlease enter the ZeroTier networkID to connect to:" 10 38 "" --title " Join ZeroTier Network " --backtitle "RaspiBlitz - Settings" 3>&1 1>&2 2>&3)
networkID=$(echo "${networkID[0]}")
if [ ${#networkID} -eq 0 ]; then
echo "# no id entered - cancel"
echo "error='cancel'"
exit 0
fi
fi