Removed referances to NVR as the script was originally created for

This commit is contained in:
phil committed 2026-10-13 15:52:51 +01:00
1 parent e2c1c7f96f
commit 3840b729a2
1 file changed
+15 -15
+15 -15
View File
@@ -20,7 +20,7 @@ LOCATION="$(
HOSTNAME="DISPLAY-NVR-$LOCATION"
[[ ${#HOSTNAME} -le 63 ]] || die "Hostname too long: $HOSTNAME"
read -r -p "Enter the NVR server URL (default: http://192.168.25.248): " URL_INPUT
read -r -p "Enter the server URL (default: http://192.168.25.248): " URL_INPUT
URL="${URL_INPUT:-http://192.168.25.248}"
[[ "$URL" =~ ^https?:// ]] || die "URL must start with http:// or https://"
@@ -31,9 +31,9 @@ REBOOT_TIME="${REBOOT_TIME:-06:00}"
APP_DIR="$HOME/.local/bin"
AUTOSTART_DIR="$HOME/.config/autostart"
XORG_CONF_DIR="/etc/X11/xorg.conf.d"
LAUNCHER="$APP_DIR/launch-nvr.sh"
DESKTOP_FILE="$AUTOSTART_DIR/launch-nvr.desktop"
CONFIG_FILE="$HOME/.config/nvr-display.conf"
LAUNCHER="$APP_DIR/launch-kiosk.sh"
DESKTOP_FILE="$AUTOSTART_DIR/launch-kiosk.desktop"
CONFIG_FILE="$HOME/.config/kiosk-display.conf"
mkdir -p "$APP_DIR" "$AUTOSTART_DIR" "$HOME/.config"
@@ -72,14 +72,14 @@ chmod 700 "$LAUNCHER"
cat > "$DESKTOP_FILE" <<EOF
[Desktop Entry]
Type=Application
Name=Launch NVR Display
Name=Launch Kiosk Display
Exec=$LAUNCHER
Terminal=false
X-GNOME-Autostart-enabled=true
X-MATE-Autostart-enabled=true
StartupNotify=false
NoDisplay=false
Comment=Automatically launch NVR display in kiosk mode
Comment=Automatically Launch Kiosk Display in kiosk mode
EOF
chmod 644 "$DESKTOP_FILE"
@@ -98,23 +98,23 @@ echo "Setting hostname to: $HOSTNAME"
sudo hostnamectl set-hostname "$HOSTNAME" || warn "Failed to set hostname."
echo "Installing daily reboot timer for $REBOOT_TIME..."
sudo tee /etc/systemd/system/nvr-daily-reboot.service >/dev/null <<'EOF'
sudo tee /etc/systemd/system/kiosk-daily-reboot.service >/dev/null <<'EOF'
[Unit]
Description=Reboot NVR display computer
Description=Reboot kiosk display computer
[Service]
Type=oneshot
ExecStart=/usr/bin/systemctl reboot
EOF
sudo tee /etc/systemd/system/nvr-daily-reboot.timer >/dev/null <<EOF
sudo tee /etc/systemd/system/kiosk-daily-reboot.timer >/dev/null <<EOF
[Unit]
Description=Reboot NVR display computer daily at $REBOOT_TIME
Description=Reboot kiosk display computer daily at $REBOOT_TIME
[Timer]
OnCalendar=*-*-* $REBOOT_TIME:00
Persistent=true
Unit=nvr-daily-reboot.service
Unit=kiosk-daily-reboot.service
AccuracySec=1s
[Install]
@@ -122,9 +122,9 @@ WantedBy=timers.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable --now nvr-daily-reboot.timer || warn "Failed to enable reboot timer."
sudo systemctl enable --now kiosk-daily-reboot.timer || warn "Failed to enable reboot timer."
if sudo systemctl is-active --quiet nvr-daily-reboot.timer; then
if sudo systemctl is-active --quiet kiosk-daily-reboot.timer; then
echo "Reboot timer is active."
else
warn "Reboot timer may not be active."
@@ -139,6 +139,6 @@ echo
echo "Next steps:"
echo "1. Reboot to test autostart: sudo reboot"
echo "2. Verify Firefox opens in kiosk mode"
echo "3. Check timer: systemctl list-timers nvr-daily-reboot.timer"
echo "4. View logs: journalctl -u nvr-daily-reboot.service -f"
echo "3. Check timer: systemctl list-timers kiosk-daily-reboot.timer"
echo "4. View logs: journalctl -u kiosk-daily-reboot.service -f"