diff --git a/ct/umami.sh b/ct/umami.sh index 9f94d0b9..065f4516 100644 --- a/ct/umami.sh +++ b/ct/umami.sh @@ -52,6 +52,33 @@ function default_settings() { echo_default } +function update_script() { +header_info +if [[ ! -d /opt/umami ]]; then msg_error "No ${APP} Installation Found!"; exit; fi +if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then + read -r -p "Warning: Storage is dangerously low, continue anyway? " prompt + [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit +fi + +msg_info "Stopping ${APP}" +systemctl stop umami +msg_ok "Stopped $APP" + +msg_info "Updating ${APP}" +cd /opt/umami +git pull +yarn install +yarn build +msg_ok "Updated ${APP}" + +msg_info "Starting ${APP}" +systemctl start umami +msg_ok "Started ${APP}" + +msg_ok "Updated Successfully" +exit +} + start build_container description