aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKablersalat <crt@adastra7.net>2025-02-24 13:31:29 +0100
committerKablersalat <crt@adastra7.net>2025-02-24 13:31:29 +0100
commitf335ffcd799158157c7aa5c2b0e9bbc741c78b79 (patch)
treea26f0aaf120c541e02c904821e0ae950ba8b5632
parentcde3bd2ffc0267742994c3dbb19b4ff5d4eff1fa (diff)
vnc password stuff
-rw-r--r--kiosk.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/kiosk.sh b/kiosk.sh
index 3e54c8b..e83321b 100644
--- a/kiosk.sh
+++ b/kiosk.sh
@@ -105,9 +105,14 @@ configure_start_sh() {
# Helper function to configure start.sh for a single website
set_start_script_single() {
+ VNC_PASSWORD=$(dialog --title "VNC Password" --inputbox "Please enter the VNC password:" 8 50 "" 3>&1 1>&2 2>&3 3>&-)
+ echo "$VNC_PASSWORD" | vncpasswd -f > /home/kiosk/.vnc/passwd
+ chmod 600 /home/kiosk/.vnc/passwd
+
cat > /home/kiosk/start.sh <<EOF
#!/bin/bash
-/usr/bin/chromium --no-first-run --disable-translate --no-default-browser-check --disable-cache --kiosk $2
+/usr/bin/chromium --no-first-run --disable-translate --no-default-browser-check --disable-cache --kiosk $2 &
+x11vnc -display :0 -auth guess -forever -rfbport 5901 -passwd $VNC_PASSWORD &
EOF
sudo chmod a+x /home/kiosk/start.sh
}
@@ -121,6 +126,10 @@ configure_tabs() {
tab_urls+="'$url' " # Ensure URLs are properly quoted
done
+ VNC_PASSWORD=$(dialog --title "VNC Password" --inputbox "Please enter the VNC password:" 8 50 "" 3>&1 1>&2 2>&3 3>&-)
+ echo "$VNC_PASSWORD" | vncpasswd -f > /home/kiosk/.vnc/passwd
+ chmod 600 /home/kiosk/.vnc/passwd
+
# Write the script with properly formatted commands
cat > /home/kiosk/start.sh <<EOF
#!/bin/bash
@@ -150,6 +159,8 @@ while true; do
sleep 30
fi
done
+
+x11vnc -display :0 -auth guess -forever -rfbport 5901 -passwd $VNC_PASSWORD &
EOF
chmod a+x /home/kiosk/start.sh
}