From bfb6c36b330478ae654eba31e36481b17d69480a Mon Sep 17 00:00:00 2001 From: tteckster Date: Sun, 23 Oct 2022 14:45:07 -0400 Subject: [PATCH] Update node-red-install.sh --- setup/node-red-install.sh | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/setup/node-red-install.sh b/setup/node-red-install.sh index babd4099..69c9a1b4 100644 --- a/setup/node-red-install.sh +++ b/setup/node-red-install.sh @@ -11,22 +11,6 @@ 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 occurred." - 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" @@ -59,13 +43,9 @@ done msg_ok "Set up Container OS" msg_ok "Network Connected: ${BL}$(hostname -I)" -set +e -alias die='' if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi; RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs) if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi; -alias die='EXIT=$? LINE=$LINENO error_exit' -set -e msg_info "Updating Container OS" apt-get update &>/dev/null @@ -75,12 +55,10 @@ msg_ok "Updated Container OS" msg_info "Installing Dependencies" apt-get install -y curl &>/dev/null apt-get install -y sudo &>/dev/null -apt-get install -y git &>/dev/null -apt-get install -y build-essential &>/dev/null msg_ok "Installed Dependencies" msg_info "Installing Node-Red" -bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --confirm-root --confirm-install --skip-pi --node18 --no-init &>/dev/null +bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) --confirm-root --confirm-install --skip-pi --no-init &>/dev/null systemctl enable --now nodered.service &>/dev/null msg_ok "Installed Node-Red"