mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-25 05:57:26 +00:00
feat: Refactor Nightscout update logic to use fetch_and_deploy_gh_release, streamline dependency installation, and update post-install messages and CT tags.
This commit is contained in:
@@ -6,7 +6,7 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/
|
||||
# Source: https://github.com/nightscout/cgm-remote-monitor
|
||||
|
||||
APP="Nightscout"
|
||||
var_tags="${var_tags:-arr;health}"
|
||||
var_tags="${var_tags:-health}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-2048}"
|
||||
var_disk="${var_disk:-10}"
|
||||
@@ -20,31 +20,39 @@ color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/nightscout ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
msg_info "Updating ${APP}"
|
||||
systemctl stop nightscout
|
||||
cd /opt/nightscout
|
||||
git pull
|
||||
npm install
|
||||
systemctl start nightscout
|
||||
msg_ok "Updated ${APP}"
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
if [[ ! -d /opt/nightscout ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nightscout" "nightscout/cgm-remote-monitor"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop nightscout
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "nightscout" "nightscout/cgm-remote-monitor" "source"
|
||||
|
||||
msg_info "Updating ${APP}"
|
||||
cd /opt/nightscout
|
||||
$STD npm install
|
||||
msg_ok "Updated ${APP}"
|
||||
|
||||
msg_info "Starting Service"
|
||||
systemctl start nightscout
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:1337${CL}"
|
||||
echo -e "${INFO}${YW} Configuration:${CL}"
|
||||
echo -e "${TAB} Edit /opt/nightscout/my.env to configure your CGM source (Dexcom/CareLink)"
|
||||
echo -e "${TAB} Then run: ${BGN}systemctl restart nightscout${CL}"
|
||||
|
||||
Reference in New Issue
Block a user