Update zwavejs2mqtt-update.sh

This commit is contained in:
tteckster 2022-05-12 17:21:31 -04:00 committed by GitHub
parent 917c650ff5
commit 2a9b48b2d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -5,6 +5,22 @@ BL=`echo "\033[36m"`
CM='\xE2\x9C\x94\033'
GN=`echo "\033[1;92m"`
CL=`echo "\033[m"`
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
}
echo -en "${GN} Updating Zwavejs2MQTT... "
systemctl stop zwavejs2mqtt.service