From a8b7a6e5adf0351a773062f6545cc8b96e000240 Mon Sep 17 00:00:00 2001 From: tteckster Date: Fri, 22 Apr 2022 16:04:59 -0400 Subject: [PATCH] Update uptimekuma-update.sh --- misc/uptimekuma-update.sh | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/misc/uptimekuma-update.sh b/misc/uptimekuma-update.sh index 35f91888..f9d8ae35 100644 --- a/misc/uptimekuma-update.sh +++ b/misc/uptimekuma-update.sh @@ -1,6 +1,4 @@ #!/usr/bin/env bash -ex -set -euo pipefail -shopt -s inherit_errexit nullglob YW=`echo "\033[33m"` BL=`echo "\033[36m"` RD=`echo "\033[01;31m"` @@ -46,15 +44,12 @@ function msg_ok() { echo -e "${BFR} ${CM} ${GN}${msg}${CL}" } -cd /opt/uptime-kuma -if which systemctl 2> /dev/null > /dev/null; then - msg_info "Stopping Uptime Kuma" - sudo systemctl stop uptime-kuma &>/dev/null - msg_ok "Stopped Uptime Kuma" -else - echo "Skipped stopping Uptime Kuma, no systemctl found" -fi +msg_info "Stopping Uptime Kuma" +sudo systemctl stop uptime-kuma &>/dev/null +msg_ok "Stopped Uptime Kuma" + +cd /opt/uptime-kuma msg_info "Updating" git fetch @@ -66,12 +61,8 @@ msg_info "Installing Dependencies" npm ci msg_ok "Installed Dependencies" -if which systemctl 2> /dev/null > /dev/null; then - msg_info "Starting Uptime Kuma" - sudo systemctl start uptime-kuma &>/dev/null - msg_ok "Started Uptime Kuma" -else - echo "Skipped starting Uptime Kuma, no systemctl found" -fi +msg_info "Starting Uptime Kuma" +sudo systemctl start uptime-kuma &>/dev/null +msg_ok "Started Uptime Kuma" msg_ok "Done!"