2025-01-22 02:57:56 +00:00
|
|
|
#!/usr/bin/env bash
|
2025-01-22 04:51:34 +00:00
|
|
|
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
2025-01-22 02:57:56 +00:00
|
|
|
# Copyright (c) 2021-2024 community-scripts ORG
|
2025-01-24 02:38:55 +00:00
|
|
|
# Author: connorjfarrell
|
2025-01-22 02:57:56 +00:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
2025-01-24 02:38:55 +00:00
|
|
|
# Source: https://zoneminder.readthedocs.io/en/latest/installationguide/ubuntu.html#ubuntu-22-04-jammy
|
2025-01-22 02:57:56 +00:00
|
|
|
|
|
|
|
APP="ZoneMinder"
|
2025-01-22 03:28:26 +00:00
|
|
|
var_tags="nvr"
|
2025-01-22 02:57:56 +00:00
|
|
|
var_cpu="2"
|
|
|
|
var_ram="2048"
|
|
|
|
var_disk="16"
|
|
|
|
var_os="ubuntu"
|
|
|
|
var_version="22.04"
|
|
|
|
var_unprivileged="1"
|
|
|
|
|
|
|
|
header_info "$APP"
|
|
|
|
base_settings
|
|
|
|
|
|
|
|
variables
|
|
|
|
color
|
|
|
|
catch_errors
|
|
|
|
|
|
|
|
function update_script() {
|
|
|
|
header_info
|
|
|
|
check_container_storage
|
|
|
|
check_container_resources
|
|
|
|
|
|
|
|
if [[ ! -f /usr/bin/zmpkg.pl ]]; then
|
|
|
|
msg_error "No ${APP} Installation Found!"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
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
|
2025-01-24 16:26:18 +00:00
|
|
|
msg_info "Updating to v${RELEASE}"
|
2025-01-22 02:57:56 +00:00
|
|
|
|
|
|
|
systemctl stop zoneminder
|
|
|
|
|
|
|
|
apt-get update && apt-get install --only-upgrade zoneminder -y
|
|
|
|
|
|
|
|
systemctl start zoneminder
|
|
|
|
sleep 2
|
|
|
|
|
|
|
|
echo "${RELEASE}" >/opt/${APP}_version.txt
|
|
|
|
msg_ok "Update Successful"
|
|
|
|
else
|
2025-01-24 16:26:18 +00:00
|
|
|
msg_ok "${APP} is already v${RELEASE}"
|
2025-01-22 02:57:56 +00:00
|
|
|
fi
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
|
|
|
start
|
|
|
|
build_container
|
|
|
|
description
|
|
|
|
|
|
|
|
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}"
|
2025-01-22 03:19:15 +00:00
|
|
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80/zm${CL}"
|