1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

New Script: Nx Witness (#2350)

* New Script: NX Witness

* Update nxwitness.json
This commit is contained in:
CanbiZ 2025-02-13 15:23:29 +01:00 committed by GitHub
parent cfa6b28131
commit 01d761ce71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 153 additions and 0 deletions

70
ct/nxwitness.sh Normal file
View File

@ -0,0 +1,70 @@
#!/usr/bin/env bash
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://nxvms.com/download/releases/linux
APP="NxWitness"
var_tags="nvr"
var_cpu="2"
var_ram="2048"
var_disk="8"
var_os="ubuntu"
var_version="24.04"
var_unprivileged="0"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/systemd/system/networkoptix-mediaserver.service ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
BASE_URL="https://updates.networkoptix.com/default/index.html"
RELEASE=$(curl -s "$BASE_URL" | grep -oP '(?<=<b>)[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?=</b>)' | head -n 1)
DETAIL_PAGE=$(curl -s "$BASE_URL#note_$RELEASE")
DOWNLOAD_URL=$(echo "$DETAIL_PAGE" | grep -oP "https://updates.networkoptix.com/default/$RELEASE/linux/nxwitness-server-[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-linux_x64\.deb" | head -n 1)
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
msg_info "Stopping ${APP}"
systemctl stop networkoptix-root-tool networkoptix-mediaserver
msg_ok "${APP} Stopped"
msg_info "Updating ${APP} to ${RELEASE}"
cd /tmp
wget -q "$DOWNLOAD_URL" -O "nxwitness-server-$RELEASE-linux_x64.deb"
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NOWARNINGS=yes
dpkg -i nxwitness-server-$RELEASE-linux_x64.deb >/dev/null 2>&1
echo "${RELEASE}" >/opt/${APP}_version.txt
msg_ok "Updated ${APP}"
msg_info "Starting ${APP}"
systemctl start networkoptix-root-tool networkoptix-mediaserver
msg_ok "Started ${APP}"
msg_info "Cleaning up"
rm -f /tmp/nxwitness-server-$RELEASE-linux_x64.deb
msg_ok "Cleaned"
msg_ok "Updated Successfully"
else
msg_ok "No update required. ${APP} is already at ${RELEASE}"
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}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7001/${CL}"

View File

@ -0,0 +1,49 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2025 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://nxvms.com/download/releases/linux
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt-get install -y \
curl \
sudo \
mc \
make \
net-tools \
ffmpeg \
cifs-utils \
libtalloc2 \
libwbclient0 \
keyutils
msg_ok "Installed Dependencies"
msg_info "Setup Nx Witness"
cd /tmp
BASE_URL="https://updates.networkoptix.com/default/index.html"
RELEASE=$(curl -s "$BASE_URL" | grep -oP '(?<=<b>)[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?=</b>)' | head -n 1)
DETAIL_PAGE=$(curl -s "$BASE_URL#note_$RELEASE")
DOWNLOAD_URL=$(echo "$DETAIL_PAGE" | grep -oP "https://updates.networkoptix.com/default/$RELEASE/linux/nxwitness-server-[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-linux_x64\.deb" | head -n 1)
wget -q "$DOWNLOAD_URL" -O "nxwitness-server-$RELEASE-linux_x64.deb"
export DEBIAN_FRONTEND=noninteractive
$STD dpkg -i nxwitness-server-$RELEASE-linux_x64.deb
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
msg_ok "Setup Nx Witness"
motd_ssh
customize
msg_info "Cleaning up"
rm -f /tmp/nxwitness-server-$RELEASE-linux_x64.deb
$STD apt-get -y autoremove
$STD apt-get -y autoclean
msg_ok "Cleaned"

34
json/nxwitness.json Normal file
View File

@ -0,0 +1,34 @@
{
"name": "Nx Witness",
"slug": "nxwitness",
"categories": [
15
],
"date_created": "2025-02-13",
"type": "ct",
"updateable": true,
"privileged": true,
"interface_port": 7001,
"documentation": "https://support.networkoptix.com/hc/en-us/articles/360006863413-Access-the-Nx-Witness-User-Manual",
"website": "https://www.networkoptix.com/nx-witness",
"logo": "https://www.networkoptix.com/hs-fs/hubfs/raw_assets/public/NetworkOptix-NB/images/logo.png?width=300&height=75&name=logo.png",
"description": "Nx Witness is a professional video management system (VMS) designed for IP cameras and surveillance systems. It provides real-time video streaming, recording, and remote access with an intuitive user interface. The software supports AI-based video analytics, integrates with third-party security systems, and offers advanced search and event management features. It is used for security monitoring, business intelligence, and large-scale surveillance deployments.",
"install_methods": [
{
"type": "default",
"script": "ct/nxwitness.sh",
"resources": {
"cpu": 2,
"ram": 2048,
"hdd": 8,
"os": "ubuntu",
"version": "24.04"
}
}
],
"default_credentials": {
"username": null,
"password": null
},
"notes": []
}