Skip to content

Commit 01d761c

Browse files
authored
New Script: Nx Witness (#2350)
* New Script: NX Witness * Update nxwitness.json
1 parent cfa6b28 commit 01d761c

File tree

3 files changed

+153
-0
lines changed

3 files changed

+153
-0
lines changed

ct/nxwitness.sh

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
#!/usr/bin/env bash
2+
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://nxvms.com/download/releases/linux
7+
8+
APP="NxWitness"
9+
var_tags="nvr"
10+
var_cpu="2"
11+
var_ram="2048"
12+
var_disk="8"
13+
var_os="ubuntu"
14+
var_version="24.04"
15+
var_unprivileged="0"
16+
17+
header_info "$APP"
18+
variables
19+
color
20+
catch_errors
21+
22+
function update_script() {
23+
header_info
24+
check_container_storage
25+
check_container_resources
26+
if [[ ! -f /etc/systemd/system/networkoptix-mediaserver.service ]]; then
27+
msg_error "No ${APP} Installation Found!"
28+
exit
29+
fi
30+
BASE_URL="https://updates.networkoptix.com/default/index.html"
31+
RELEASE=$(curl -s "$BASE_URL" | grep -oP '(?<=<b>)[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?=</b>)' | head -n 1)
32+
DETAIL_PAGE=$(curl -s "$BASE_URL#note_$RELEASE")
33+
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)
34+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
35+
msg_info "Stopping ${APP}"
36+
systemctl stop networkoptix-root-tool networkoptix-mediaserver
37+
msg_ok "${APP} Stopped"
38+
39+
msg_info "Updating ${APP} to ${RELEASE}"
40+
cd /tmp
41+
wget -q "$DOWNLOAD_URL" -O "nxwitness-server-$RELEASE-linux_x64.deb"
42+
export DEBIAN_FRONTEND=noninteractive
43+
export DEBCONF_NOWARNINGS=yes
44+
dpkg -i nxwitness-server-$RELEASE-linux_x64.deb >/dev/null 2>&1
45+
echo "${RELEASE}" >/opt/${APP}_version.txt
46+
msg_ok "Updated ${APP}"
47+
48+
msg_info "Starting ${APP}"
49+
systemctl start networkoptix-root-tool networkoptix-mediaserver
50+
msg_ok "Started ${APP}"
51+
52+
msg_info "Cleaning up"
53+
rm -f /tmp/nxwitness-server-$RELEASE-linux_x64.deb
54+
msg_ok "Cleaned"
55+
56+
msg_ok "Updated Successfully"
57+
else
58+
msg_ok "No update required. ${APP} is already at ${RELEASE}"
59+
fi
60+
exit
61+
}
62+
63+
start
64+
build_container
65+
description
66+
67+
msg_ok "Completed Successfully!\n"
68+
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
69+
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
70+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:7001/${CL}"

install/nxwitness-install.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: MickLesk (CanbiZ)
5+
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
6+
# Source: https://nxvms.com/download/releases/linux
7+
8+
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
9+
color
10+
verb_ip6
11+
catch_errors
12+
setting_up_container
13+
network_check
14+
update_os
15+
16+
msg_info "Installing Dependencies"
17+
$STD apt-get install -y \
18+
curl \
19+
sudo \
20+
mc \
21+
make \
22+
net-tools \
23+
ffmpeg \
24+
cifs-utils \
25+
libtalloc2 \
26+
libwbclient0 \
27+
keyutils
28+
msg_ok "Installed Dependencies"
29+
30+
msg_info "Setup Nx Witness"
31+
cd /tmp
32+
BASE_URL="https://updates.networkoptix.com/default/index.html"
33+
RELEASE=$(curl -s "$BASE_URL" | grep -oP '(?<=<b>)[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+(?=</b>)' | head -n 1)
34+
DETAIL_PAGE=$(curl -s "$BASE_URL#note_$RELEASE")
35+
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)
36+
wget -q "$DOWNLOAD_URL" -O "nxwitness-server-$RELEASE-linux_x64.deb"
37+
export DEBIAN_FRONTEND=noninteractive
38+
$STD dpkg -i nxwitness-server-$RELEASE-linux_x64.deb
39+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
40+
msg_ok "Setup Nx Witness"
41+
42+
motd_ssh
43+
customize
44+
45+
msg_info "Cleaning up"
46+
rm -f /tmp/nxwitness-server-$RELEASE-linux_x64.deb
47+
$STD apt-get -y autoremove
48+
$STD apt-get -y autoclean
49+
msg_ok "Cleaned"

json/nxwitness.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "Nx Witness",
3+
"slug": "nxwitness",
4+
"categories": [
5+
15
6+
],
7+
"date_created": "2025-02-13",
8+
"type": "ct",
9+
"updateable": true,
10+
"privileged": true,
11+
"interface_port": 7001,
12+
"documentation": "https://support.networkoptix.com/hc/en-us/articles/360006863413-Access-the-Nx-Witness-User-Manual",
13+
"website": "https://www.networkoptix.com/nx-witness",
14+
"logo": "https://www.networkoptix.com/hs-fs/hubfs/raw_assets/public/NetworkOptix-NB/images/logo.png?width=300&height=75&name=logo.png",
15+
"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.",
16+
"install_methods": [
17+
{
18+
"type": "default",
19+
"script": "ct/nxwitness.sh",
20+
"resources": {
21+
"cpu": 2,
22+
"ram": 2048,
23+
"hdd": 8,
24+
"os": "ubuntu",
25+
"version": "24.04"
26+
}
27+
}
28+
],
29+
"default_credentials": {
30+
"username": null,
31+
"password": null
32+
},
33+
"notes": []
34+
}

0 commit comments

Comments
 (0)