Selaa lähdekoodia

maintenance (#569)

update whiptail menu
tteckster 2 vuotta sitten
vanhempi
commit
1e8ac7e63e
53 muutettua tiedostoa jossa 1552 lisäystä ja 2114 poistoa
  1. 29 39
      ct/adguard-v4.sh
  2. 29 39
      ct/casaos-v4.sh
  3. 29 39
      ct/daemonsync-v4.sh
  4. 29 39
      ct/dashy-v4.sh
  5. 29 39
      ct/debian-v4.sh
  6. 31 53
      ct/deconz-v4.sh
  7. 29 39
      ct/docker-v4.sh
  8. 30 44
      ct/emby-v4.sh
  9. 29 39
      ct/emqx-v4.sh
  10. 29 39
      ct/esphome-v4.sh
  11. 29 39
      ct/grafana-v4.sh
  12. 29 39
      ct/grocy-v4.sh
  13. 29 39
      ct/heimdalldashboard-v4.sh
  14. 29 39
      ct/homeassistant-v4.sh
  15. 29 39
      ct/homebridge-v4.sh
  16. 29 39
      ct/homepage-v4.sh
  17. 29 39
      ct/influxdb-v4.sh
  18. 29 39
      ct/iobroker-v4.sh
  19. 30 44
      ct/jellyfin-v4.sh
  20. 29 39
      ct/keycloak-v4.sh
  21. 29 39
      ct/magicmirror-v4.sh
  22. 29 39
      ct/mariadb-v4.sh
  23. 29 39
      ct/meshcentral-v4.sh
  24. 29 39
      ct/motioneye-v4.sh
  25. 29 39
      ct/mqtt-v4.sh
  26. 29 39
      ct/n8n-v4.sh
  27. 29 39
      ct/navidrome-v4.sh
  28. 31 41
      ct/nextcloudpi-v4.sh
  29. 29 39
      ct/nginx-proxy-manager-v4.sh
  30. 29 39
      ct/nocodb-v4.sh
  31. 29 39
      ct/node-red-v4.sh
  32. 30 44
      ct/omada-v4.sh
  33. 31 41
      ct/omv-v4.sh
  34. 29 39
      ct/openhab-v4.sh
  35. 29 39
      ct/paperless-ngx-v4.sh
  36. 29 39
      ct/photoprism-v4.sh
  37. 31 41
      ct/pihole-v4.sh
  38. 30 44
      ct/plex-v4.sh
  39. 31 41
      ct/podman-homeassistant-v4.sh
  40. 29 39
      ct/postgresql-v4.sh
  41. 29 39
      ct/prometheus-v4.sh
  42. 29 39
      ct/syncthing-v4.sh
  43. 29 39
      ct/technitiumdns-v4.sh
  44. 29 39
      ct/trilium-v4.sh
  45. 30 44
      ct/ubuntu-v4.sh
  46. 29 39
      ct/unifi-v4.sh
  47. 29 39
      ct/uptimekuma-v4.sh
  48. 29 39
      ct/vaultwarden-v4.sh
  49. 29 39
      ct/whoogle-v4.sh
  50. 29 39
      ct/wikijs-v4.sh
  51. 29 39
      ct/wireguard-v4.sh
  52. 29 39
      ct/zigbee2mqtt-v4.sh
  53. 29 39
      ct/zwave-js-ui-v4.sh

+ 29 - 39
ct/adguard-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/casaos-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/daemonsync-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/dashy-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/debian-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 31 - 53
ct/deconz-v4.sh

@@ -97,29 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10 58 4 \
-"18.04" "Bionic" OFF \
-"20.04" "Focal" ON \
-"21.10" "Impish" OFF \
-"22.04" "Jammy" OFF \
-3>&1 1>&2 2>&3)
-exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
-else
-    exit
-fi
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
-"1" "Unprivileged" OFF \
-"0" "Privileged" ON \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
+"1" "Unprivileged" ON \
+"0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -129,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -190,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -200,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -210,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -220,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/docker-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 30 - 44
ct/emby-v4.sh

@@ -104,22 +104,16 @@ var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10
 "21.10" "Impish" OFF \
 "21.10" "Impish" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
-else
-    exit
-fi
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"; fi
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" OFF \
 "1" "Unprivileged" OFF \
 "0" "Privileged" ON \
 "0" "Privileged" ON \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -129,58 +123,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -190,7 +176,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -200,7 +186,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -210,7 +196,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -220,7 +206,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/emqx-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/esphome-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/grafana-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/grocy-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/heimdalldashboard-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/homeassistant-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/homebridge-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/homepage-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/influxdb-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/iobroker-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 30 - 44
ct/jellyfin-v4.sh

@@ -104,22 +104,16 @@ var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10
 "21.10" "Impish" OFF \
 "21.10" "Impish" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
-else
-    exit
-fi
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"; fi
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" OFF \
 "1" "Unprivileged" OFF \
 "0" "Privileged" ON \
 "0" "Privileged" ON \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -129,58 +123,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -190,7 +176,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -200,7 +186,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -210,7 +196,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -220,7 +206,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/keycloak-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/magicmirror-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/mariadb-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/meshcentral-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/motioneye-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/mqtt-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/n8n-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/navidrome-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 31 - 41
ct/nextcloudpi-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
-"1" "Unprivileged" OFF \
-"0" "Privileged" ON \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
+"1" "Unprivileged" ON \
+"0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/nginx-proxy-manager-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/nocodb-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/node-red-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 30 - 44
ct/omada-v4.sh

@@ -104,22 +104,16 @@ var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10
 "22.04" "Jammy" OFF \
 "22.04" "Jammy" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
-else
-    exit
-fi
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"; fi
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -129,58 +123,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -190,7 +176,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -200,7 +186,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -210,7 +196,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -220,7 +206,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 31 - 41
ct/omv-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
-"1" "Unprivileged" OFF \
-"0" "Privileged" ON \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
+"1" "Unprivileged" ON \
+"0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/openhab-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/paperless-ngx-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/photoprism-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 31 - 41
ct/pihole-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
-"1" "Unprivileged" OFF \
-"0" "Privileged" ON \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
+"1" "Unprivileged" ON \
+"0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 30 - 44
ct/plex-v4.sh

@@ -104,22 +104,16 @@ var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10
 "21.10" "Impish" OFF \
 "21.10" "Impish" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
-else
-    exit
-fi
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"; fi
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" OFF \
 "1" "Unprivileged" OFF \
 "0" "Privileged" ON \
 "0" "Privileged" ON \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -129,58 +123,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -190,7 +176,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -200,7 +186,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -210,7 +196,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -220,7 +206,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 31 - 41
ct/podman-homeassistant-v4.sh

@@ -100,17 +100,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
-"1" "Unprivileged" OFF \
-"0" "Privileged" ON \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
+"1" "Unprivileged" ON \
+"0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -120,58 +118,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -181,7 +171,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -191,7 +181,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -201,7 +191,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -211,7 +201,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/postgresql-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/prometheus-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/syncthing-v4.sh

@@ -98,17 +98,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -118,58 +116,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -179,7 +169,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -189,7 +179,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -199,7 +189,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -209,7 +199,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/technitiumdns-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/trilium-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 30 - 44
ct/ubuntu-v4.sh

@@ -104,22 +104,16 @@ var_version=$(whiptail --title "UBUNTU VERSION" --radiolist "Choose Version" 10
 "22.04" "Jammy" ON \
 "22.04" "Jammy" ON \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"
-else
-    exit
-fi
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Ubuntu Version: ${BGN}$var_version${CL}"; fi
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -129,58 +123,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -190,7 +176,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -200,7 +186,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -210,7 +196,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -220,7 +206,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/unifi-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/uptimekuma-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/vaultwarden-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/whoogle-v4.sh

@@ -96,17 +96,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -116,58 +114,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -177,7 +167,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -187,7 +177,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -197,7 +187,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -207,7 +197,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/wikijs-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/wireguard-v4.sh

@@ -98,17 +98,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" ON \
 "1" "Unprivileged" ON \
 "0" "Privileged" OFF \
 "0" "Privileged" OFF \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -118,58 +116,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -179,7 +169,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -189,7 +179,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -199,7 +189,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -209,7 +199,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/zigbee2mqtt-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" OFF \
 "1" "Unprivileged" OFF \
 "0" "Privileged" ON \
 "0" "Privileged" ON \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID?" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings

+ 29 - 39
ct/zwave-js-ui-v4.sh

@@ -97,17 +97,15 @@ function default_settings() {
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 		echo -e "${BL}Creating a ${APP} LXC using the above default settings${CL}"
 }
 }
 function advanced_settings() {
 function advanced_settings() {
-CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist "Choose Type" 8 58 2 \
+CT_TYPE=$(whiptail --title "CONTAINER TYPE" --radiolist --cancel-button Exit-Script "Choose Type" 8 58 2 \
 "1" "Unprivileged" OFF \
 "1" "Unprivileged" OFF \
 "0" "Privileged" ON \
 "0" "Privileged" ON \
 3>&1 1>&2 2>&3)
 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
     echo -e "${DGN}Using Container Type: ${BGN}$CT_TYPE${CL}"
-else
-    exit
 fi
 fi
-PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" 3>&1 1>&2 2>&3)
+PW1=$(whiptail --inputbox "Set Root Password" 8 58  --title "PASSWORD(leave blank for automatic login)" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
   if [ -z $PW1 ]; then PW1="Automatic Login" PW=" ";
@@ -117,58 +115,50 @@ else
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
     echo -e "${DGN}Using Root Password: ${BGN}$PW1${CL}"
   fi
   fi
 fi
 fi
-CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" 3>&1 1>&2 2>&3)
+CT_ID=$(whiptail --inputbox "Set Container ID" 8 58 $NEXTID --title "CONTAINER ID" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"
+if [ -z $CT_ID ]; then CT_ID="$NEXTID"; echo -e "${DGN}Container ID: ${BGN}$CT_ID${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Container ID: ${BGN}$CT_ID${CL}"; fi;
 fi
 fi
-CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" 3>&1 1>&2 2>&3)
+CT_NAME=$(whiptail --inputbox "Set Hostname" 8 58 $NSAPP --title "HOSTNAME" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    HN=$(echo ${CT_NAME,,} | tr -d ' ')
-    echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"
+if [ -z $CT_NAME ]; then HN="$NSAPP"; echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then HN=$(echo ${CT_NAME,,} | tr -d ' '); echo -e "${DGN}Using Hostname: ${BGN}$HN${CL}"; fi;
 fi
 fi
-DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" 3>&1 1>&2 2>&3)
+DISK_SIZE=$(whiptail --inputbox "Set Disk Size in GB" 8 58 $var_disk --title "DISK SIZE" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"
-    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
+if [ -z $DISK_SIZE ]; then DISK_SIZE="$var_disk"; echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Disk Size: ${BGN}$DISK_SIZE${CL}"; fi;
+    if ! [[ $DISK_SIZE =~ $INTEGER ]] ; then echo -e "${RD}⚠ DISK SIZE MUST BE A INTEGER NUMBER!${CL}"; advanced_settings; fi;
 fi
 fi
-CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" 3>&1 1>&2 2>&3)
+CORE_COUNT=$(whiptail --inputbox "Allocate CPU Cores" 8 58 $var_cpu --title "CORE COUNT" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"
+if [ -z $CORE_COUNT ]; then CORE_COUNT="$var_cpu"; echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated Cores: ${BGN}$CORE_COUNT${CL}"; fi;
 fi
 fi
-RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" 3>&1 1>&2 2>&3)
+RAM_SIZE=$(whiptail --inputbox "Allocate RAM in MiB" 8 58 $var_ram --title "RAM" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"
+if [ -z $RAM_SIZE ]; then RAM_SIZE="$var_ram"; echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Allocated RAM: ${BGN}$RAM_SIZE${CL}"; fi;
 fi
 fi
-BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE" 3>&1 1>&2 2>&3)
+BRG=$(whiptail --inputbox "Set a Bridge" 8 58 vmbr0 --title "BRIDGE"--cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"
+if [ -z $BRG ]; then BRG="vmbr0"; echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using Bridge: ${BGN}$BRG${CL}"; fi;
 fi
 fi
-NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" 3>&1 1>&2 2>&3)
+NET=$(whiptail --inputbox "Set a Static IPv4 CIDR Address(/24)" 8 58 dhcp --title "IP ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
-if [ $exitstatus = 0 ]; then
-    echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"
+if [ -z $NET ]; then NET="dhcp"; echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}";
 else
 else
-    exit
+  if [ $exitstatus = 0 ]; then echo -e "${DGN}Using IP Address: ${BGN}$NET${CL}"; fi;
 fi
 fi
-GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" 3>&1 1>&2 2>&3)
+GATE1=$(whiptail --inputbox "Set a Gateway IP (mandatory if Static IP was used)" 8 58  --title "GATEWAY IP" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
   if [ -z $GATE1 ]; then GATE1="Default" GATE="";
@@ -178,7 +168,7 @@ else
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
     echo -e "${DGN}Using Gateway IP Address: ${BGN}$GATE1${CL}"
   fi
   fi
 fi
 fi
-MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" 3>&1 1>&2 2>&3)
+MAC1=$(whiptail --inputbox "Set a MAC Address(leave blank for default)" 8 58  --title "MAC ADDRESS" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
   if [ -z $MAC1 ]; then MAC1="Default" MAC="";
@@ -188,7 +178,7 @@ else
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
     echo -e "${DGN}Using MAC Address: ${BGN}$MAC1${CL}"
   fi
   fi
 fi
 fi
-VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" 3>&1 1>&2 2>&3)
+VLAN1=$(whiptail --inputbox "Set a Vlan(leave blank for default)" 8 58  --title "VLAN" --cancel-button Exit-Script 3>&1 1>&2 2>&3)
 exitstatus=$?
 exitstatus=$?
 if [ $exitstatus = 0 ]; then
 if [ $exitstatus = 0 ]; then
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
   if [ -z $VLAN1 ]; then VLAN1="Default" VLAN="";
@@ -198,7 +188,7 @@ else
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
     echo -e "${DGN}Using Vlan: ${BGN}$VLAN1${CL}"
   fi  
   fi  
 fi
 fi
-if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" 10 58); then
+if (whiptail --title "ADVANCED SETTINGS COMPLETE" --yesno "Ready to create ${APP} LXC?" --no-button Do-Over 10 58); then
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
     echo -e "${RD}Creating a ${APP} LXC using the above advanced settings${CL}"
 else
 else
   clear
   clear
@@ -208,7 +198,7 @@ else
 fi
 fi
 }
 }
 function start_script() {
 function start_script() {
-if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" 10 58); then
+if (whiptail --title "SETTINGS" --yesno "Use Default Settings?" --no-button Advanced 10 58); then
   header_info
   header_info
   echo -e "${BL}Using Default Settings${CL}"
   echo -e "${BL}Using Default Settings${CL}"
   default_settings
   default_settings