Update uptimekuma-update.sh

This commit is contained in:
tteckster 2022-04-22 16:04:59 -04:00 committed by GitHub
parent f61f6e7c1c
commit a8b7a6e5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 17 deletions

View File

@ -1,6 +1,4 @@
#!/usr/bin/env bash -ex #!/usr/bin/env bash -ex
set -euo pipefail
shopt -s inherit_errexit nullglob
YW=`echo "\033[33m"` YW=`echo "\033[33m"`
BL=`echo "\033[36m"` BL=`echo "\033[36m"`
RD=`echo "\033[01;31m"` RD=`echo "\033[01;31m"`
@ -46,15 +44,12 @@ function msg_ok() {
echo -e "${BFR} ${CM} ${GN}${msg}${CL}" 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" msg_info "Updating"
git fetch git fetch
@ -66,12 +61,8 @@ msg_info "Installing Dependencies"
npm ci npm ci
msg_ok "Installed Dependencies" msg_ok "Installed Dependencies"
if which systemctl 2> /dev/null > /dev/null; then msg_info "Starting Uptime Kuma"
msg_info "Starting Uptime Kuma" sudo systemctl start uptime-kuma &>/dev/null
sudo systemctl start uptime-kuma &>/dev/null msg_ok "Started Uptime Kuma"
msg_ok "Started Uptime Kuma"
else
echo "Skipped starting Uptime Kuma, no systemctl found"
fi
msg_ok "Done!" msg_ok "Done!"