Browse Source

Merge pull request #193 from tteck/dev

Improve ERROR Handling
tteckster 3 years ago
parent
commit
3272d13755
67 changed files with 1151 additions and 269 deletions
  1. 18 3
      ct/adguard-v3.sh
  2. 19 33
      ct/create_lxc.sh
  3. 18 4
      ct/daemonsync-v3.sh
  4. 18 4
      ct/dashy-v3.sh
  5. 28 13
      ct/debian-v3.sh
  6. 18 3
      ct/docker-v3.sh
  7. 18 4
      ct/esphome-v3.sh
  8. 18 4
      ct/grafana-v3.sh
  9. 18 4
      ct/heimdalldashboard-v3.sh
  10. 18 3
      ct/homeassistant-v3.sh
  11. 18 4
      ct/homebridge-v3.sh
  12. 18 4
      ct/influxdb-v3.sh
  13. 18 4
      ct/iobroker-v3.sh
  14. 18 3
      ct/jellyfin-v3.sh
  15. 18 4
      ct/mariadb-v3.sh
  16. 18 4
      ct/meshcentral-v3.sh
  17. 18 4
      ct/motioneye-v3.sh
  18. 18 4
      ct/mqtt-v3.sh
  19. 18 4
      ct/nginx-proxy-manager-v3.sh
  20. 18 4
      ct/nocodb-v3.sh
  21. 18 4
      ct/node-red-v3.sh
  22. 18 4
      ct/omada-v3.sh
  23. 18 3
      ct/photoprism-v3.sh
  24. 18 4
      ct/pihole-v3.sh
  25. 18 3
      ct/plex-v3.sh
  26. 18 3
      ct/podman-homeassistant-v3.sh
  27. 18 4
      ct/technitiumdns-v3.sh
  28. 18 4
      ct/ubuntu-v3.sh
  29. 18 4
      ct/unifi-v3.sh
  30. 18 4
      ct/uptimekuma-v3.sh
  31. 18 4
      ct/vaultwarden-v3.sh
  32. 18 4
      ct/wireguard-v3.sh
  33. 18 3
      ct/zigbee2mqtt-v3.sh
  34. 1 3
      ct/zwavejs2mqtt-v3.sh
  35. 17 3
      setup/adguard-install.sh
  36. 17 3
      setup/daemonsync-install.sh
  37. 17 3
      setup/dashy-install.sh
  38. 17 3
      setup/debian-install.sh
  39. 17 3
      setup/docker-install.sh
  40. 17 4
      setup/esphome-install.sh
  41. 17 3
      setup/grafana-install.sh
  42. 17 3
      setup/heimdalldashboard-install.sh
  43. 17 4
      setup/homeassistant-install.sh
  44. 17 3
      setup/homebridge-install.sh
  45. 17 3
      setup/influxdb-install.sh
  46. 17 3
      setup/iobroker-install.sh
  47. 17 3
      setup/jellyfin-install.sh
  48. 17 3
      setup/mariadb-install.sh
  49. 17 3
      setup/meshcentral-install.sh
  50. 17 3
      setup/motioneye-install.sh
  51. 17 3
      setup/mqtt-install.sh
  52. 17 3
      setup/nginx-proxy-manager-install.sh
  53. 17 3
      setup/nocodb-install.sh
  54. 17 3
      setup/node-red-install.sh
  55. 17 3
      setup/omada-install.sh
  56. 17 3
      setup/photoprism-install.sh
  57. 1 3
      setup/pihole-install.sh
  58. 17 3
      setup/plex-install.sh
  59. 17 4
      setup/podman-homeassistant-install.sh
  60. 17 3
      setup/technitiumdns-install.sh
  61. 17 3
      setup/ubuntu-install.sh
  62. 17 3
      setup/unifi-install.sh
  63. 17 3
      setup/uptimekuma-install.sh
  64. 17 3
      setup/vaultwarden-install.sh
  65. 17 3
      setup/wireguard-install.sh
  66. 17 4
      setup/zigbee2mqtt-install.sh
  67. 17 4
      setup/zwavejs2mqtt-install.sh

+ 18 - 3
ct/adguard-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
@@ -16,6 +14,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Adguard"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 19 - 33
ct/create_lxc.sh

@@ -1,11 +1,4 @@
 #!/usr/bin/env bash
-
-set -o errexit
-set -o errtrace
-set -o nounset
-set -o pipefail
-shopt -s expand_aliases
-alias die='EXIT=$? LINE=$LINENO error_exit'
 YW=`echo "\033[33m"`
 BL=`echo "\033[36m"`
 RD=`echo "\033[01;31m"`
@@ -14,40 +7,33 @@ CL=`echo "\033[m"`
 CM="${GN}✓${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
 trap die ERR
 
-function msg_info() {
-    local msg="$1"
-    echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
-    local msg="$1"
-    echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
 function error_exit() {
   trap - ERR
-  local DEFAULT='Unknown failure occured.'
-  local REASON="\e[97m${1:-$DEFAULT}\e[39m"
-  local FLAG="\e[91m[ERROR] \e[93m$EXIT@$LINE"
-  msg "$FLAG $REASON" 1>&2
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
   exit $EXIT
 }
-function warn() {
-  local REASON="\e[97m$1\e[39m"
-  local FLAG="\e[93m[WARNING]\e[39m"
-  msg "$FLAG $REASON"
-}
-function info() {
-  local REASON="$1"
-  local FLAG="\e[36m[INFO]\e[39m"
-  msg "$FLAG $REASON"
+
+function msg_info() {
+   local msg="$1"
+   echo -ne " ${HOLD} ${YW}${msg}..."
 }
-function msg() {
-  local TEXT="$1"
-  echo -e "$TEXT"
+
+function msg_ok() {
+   local msg="$1"
+   echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
 }
+
 function select_storage() {
   local CLASS=$1
   local CONTENT

+ 18 - 4
ct/daemonsync-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Daemon Sync"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/dashy-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Dashy"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 28 - 13
ct/debian-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 APP="Debian"
 var_disk="2"
 var_cpu="1"
@@ -21,6 +19,33 @@ CL=`echo "\033[m"`
 BFR="\\r\\033[K"
 HOLD="-"
 CM="${GN}✓${CL}"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
+function msg_info() {
+   local msg="$1"
+   echo -ne " ${HOLD} ${YW}${msg}..."
+}
+
+function msg_ok() {
+   local msg="$1"
+   echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in
@@ -43,16 +68,6 @@ ${CL}"
 
 header_info
 
-function msg_info() {
-    local msg="$1"
-    echo -ne " ${HOLD} ${YW}${msg}..."
-}
-
-function msg_ok() {
-    local msg="$1"
-    echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
-}
-
 function PVE_CHECK() {
     PVE=$(pveversion | grep "pve-manager/7" | wc -l)
 

+ 18 - 3
ct/docker-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -15,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Docker"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/esphome-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="ESPHome"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/grafana-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Grafana"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/heimdalldashboard-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 PP=`echo "\e[1;35m"`
@@ -17,6 +14,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Heimdall Dashboard"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 3
ct/homeassistant-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -15,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Home Assistant"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/homebridge-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Homebridge"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/influxdb-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="InfluxDB"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/iobroker-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="ioBroker"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 3
ct/jellyfin-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +14,23 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 APP="Jellyfin"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/mariadb-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="MariaDB"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/meshcentral-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="MeshCentral"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/motioneye-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Motioneye"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/mqtt-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="MQTT"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/nginx-proxy-manager-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Nginx Proxy Manager"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/nocodb-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="NocoDB"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/node-red-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Node Red"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/omada-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Omada"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 3
ct/photoprism-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 PP=`echo "\e[1;35m"`
@@ -16,6 +14,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="PhotoPrism"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/pihole-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Pihole"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 3
ct/plex-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +14,23 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 APP="Plex"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 3
ct/podman-homeassistant-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +14,23 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 APP="P-Home Assistant"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/technitiumdns-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Technitium DNS"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/ubuntu-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Ubuntu"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/unifi-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Unifi"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/uptimekuma-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Uptime Kuma"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/vaultwarden-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Vaultwarden"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 4
ct/wireguard-v3.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +13,23 @@ HOLD="-"
 CM="${GN}✓${CL}"
 APP="Wireguard"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 18 - 3
ct/zigbee2mqtt-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`
@@ -16,6 +14,23 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 APP="Zigbee2MQTT"
 NSAPP=$(echo ${APP,,} | tr -d ' ')
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
+
 while true; do
     read -p "This will create a New ${APP} LXC. Proceed(y/n)?" yn
     case $yn in

+ 1 - 3
ct/zwavejs2mqtt-v3.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 NEXTID=$(pvesh get /cluster/nextid)
 INTEGER='^[0-9]+$'
 YW=`echo "\033[33m"`

+ 17 - 3
setup/adguard-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/daemonsync-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/dashy-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/debian-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/docker-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 4
setup/esphome-install.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -14,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/grafana-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/heimdalldashboard-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 4
setup/homeassistant-install.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -14,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/homebridge-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/influxdb-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/iobroker-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/jellyfin-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/mariadb-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/meshcentral-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/motioneye-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/mqtt-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/nginx-proxy-manager-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/nocodb-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/node-red-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/omada-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/photoprism-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 1 - 3
setup/pihole-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`

+ 17 - 3
setup/plex-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 4
setup/podman-homeassistant-install.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -14,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/technitiumdns-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/ubuntu-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/unifi-install.sh

@@ -1,7 +1,5 @@
-#!/usr/bin/env bash -ex
+#!/usr/bin/env bash
 #https://community.ui.com/questions/UniFi-Installation-Scripts-or-UniFi-Easy-Update-Script-or-UniFi-Lets-Encrypt-or-UniFi-Easy-Encrypt-/ccbc7530-dd61-40a7-82ec-22b17f027776
-set -euo pipefail
-shopt -s inherit_errexit nullglob
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -14,6 +12,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/uptimekuma-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/vaultwarden-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 3
setup/wireguard-install.sh

@@ -1,6 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -13,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 4
setup/zigbee2mqtt-install.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -14,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"

+ 17 - 4
setup/zwavejs2mqtt-install.sh

@@ -1,7 +1,4 @@
-#!/usr/bin/env bash -ex
-set -euo pipefail
-shopt -s inherit_errexit nullglob
-
+#!/usr/bin/env bash
 YW=`echo "\033[33m"`
 RD=`echo "\033[01;31m"`
 BL=`echo "\033[36m"`
@@ -14,6 +11,22 @@ CM="${GN}✓${CL}"
 CROSS="${RD}✗${CL}"
 BFR="\\r\\033[K"
 HOLD="-"
+set -o errexit
+set -o errtrace
+set -o nounset
+set -o pipefail
+shopt -s expand_aliases
+alias die='EXIT=$? LINE=$LINENO error_exit'
+trap die ERR
+
+function error_exit() {
+  trap - ERR
+  local reason="Unknown failure occured."
+  local msg="${1:-$reason}"
+  local flag="${RD}‼ ERROR ${CL}$EXIT@$LINE"
+  echo -e "$flag $msg" 1>&2
+  exit $EXIT
+}
 
 function msg_info() {
     local msg="$1"