Ver Fonte

vnc password stuff

Kablersalat há 9 meses atrás
pai
commit
f335ffcd79
1 ficheiros alterados com 12 adições e 1 exclusões
  1. 12 1
      kiosk.sh

+ 12 - 1
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
 }