mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-03-12 08:30:01 +00:00
remove comments
This commit is contained in:
parent
b74d275b3e
commit
691c9209dd
@ -5,29 +5,18 @@ source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/m
|
|||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy
|
# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy
|
||||||
|
|
||||||
# App Default Values
|
|
||||||
APP="ZoneMinder"
|
APP="ZoneMinder"
|
||||||
# Name of the app (e.g. Google, Adventurelog, Apache-Guacamole)
|
|
||||||
var_tags="nvr"
|
var_tags="nvr"
|
||||||
# Tags for Proxmox VE, maximum 2 pcs., no spaces allowed, separated by a semicolon ; (e.g. database | adblock;dhcp)
|
|
||||||
var_cpu="2"
|
var_cpu="2"
|
||||||
# Number of cores (1-X) (e.g. 4) - default is 2
|
|
||||||
var_ram="2048"
|
var_ram="2048"
|
||||||
# Amount of used RAM in MB (e.g. 2048 or 4096)
|
|
||||||
var_disk="16"
|
var_disk="16"
|
||||||
# Amount of used disk space in GB (e.g. 4 or 10)
|
|
||||||
var_os="ubuntu"
|
var_os="ubuntu"
|
||||||
# Default OS (e.g. debian, ubuntu, alpine)
|
|
||||||
var_version="22.04"
|
var_version="22.04"
|
||||||
# Default OS version (e.g. 12 for debian, 24.04 for ubuntu, 3.20 for alpine)
|
|
||||||
var_unprivileged="1"
|
var_unprivileged="1"
|
||||||
# 1 = unprivileged container, 0 = privileged container
|
|
||||||
|
|
||||||
# App Output & Base Settings
|
|
||||||
header_info "$APP"
|
header_info "$APP"
|
||||||
base_settings
|
base_settings
|
||||||
|
|
||||||
# Core
|
|
||||||
variables
|
variables
|
||||||
color
|
color
|
||||||
catch_errors
|
catch_errors
|
||||||
@ -37,47 +26,36 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
# Check if installation is present | -f for file, -d for folder
|
|
||||||
# We assume zmpkg.pl is present if ZoneMinder was installed
|
|
||||||
if [[ ! -f /usr/bin/zmpkg.pl ]]; then
|
if [[ ! -f /usr/bin/zmpkg.pl ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the latest available release tag from GitHub
|
|
||||||
# NOTE: The container must have 'grep' available (which is standard).
|
|
||||||
RELEASE=$(curl -fsSL https://api.github.com/repos/ZoneMinder/zoneminder/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
|
RELEASE=$(curl -fsSL https://api.github.com/repos/ZoneMinder/zoneminder/releases/latest | grep -Po '"tag_name": "\K.*?(?=")')
|
||||||
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null || echo 'none')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
if [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt 2>/dev/null || echo 'none')" ]] || [[ ! -f /opt/${APP}_version.txt ]]; then
|
||||||
msg_info "Updating $APP"
|
msg_info "Updating $APP"
|
||||||
|
|
||||||
# Stopping Services
|
|
||||||
msg_info "Stopping $APP"
|
msg_info "Stopping $APP"
|
||||||
systemctl stop zoneminder
|
systemctl stop zoneminder
|
||||||
msg_ok "Stopped $APP"
|
msg_ok "Stopped $APP"
|
||||||
|
|
||||||
# Creating Backup
|
|
||||||
# Adjust paths as needed for your environment
|
|
||||||
msg_info "Creating Backup"
|
msg_info "Creating Backup"
|
||||||
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /etc/zm /usr/share/zoneminder /var/cache/zoneminder
|
tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" /etc/zm /usr/share/zoneminder /var/cache/zoneminder
|
||||||
msg_ok "Backup Created"
|
msg_ok "Backup Created"
|
||||||
|
|
||||||
# Execute Update (apt-based)
|
|
||||||
msg_info "Updating $APP to v${RELEASE}"
|
msg_info "Updating $APP to v${RELEASE}"
|
||||||
apt-get update && apt-get install --only-upgrade zoneminder -y
|
apt-get update && apt-get install --only-upgrade zoneminder -y
|
||||||
msg_ok "Updated $APP to v${RELEASE}"
|
msg_ok "Updated $APP to v${RELEASE}"
|
||||||
|
|
||||||
# Starting Services
|
|
||||||
msg_info "Starting $APP"
|
msg_info "Starting $APP"
|
||||||
systemctl start zoneminder
|
systemctl start zoneminder
|
||||||
sleep 2
|
sleep 2
|
||||||
msg_ok "Started $APP"
|
msg_ok "Started $APP"
|
||||||
|
|
||||||
# Cleaning up
|
|
||||||
msg_info "Cleaning Up"
|
msg_info "Cleaning Up"
|
||||||
rm -rf /tmp/zoneminder-update
|
rm -rf /tmp/zoneminder-update
|
||||||
msg_ok "Cleanup Completed"
|
msg_ok "Cleanup Completed"
|
||||||
|
|
||||||
# Write out the new version
|
|
||||||
echo "${RELEASE}" >/opt/${APP}_version.txt
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
||||||
msg_ok "Update Successful"
|
msg_ok "Update Successful"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user