diff options
Diffstat (limited to 'kiosk.sh')
-rw-r--r-- | kiosk.sh | 46 |
1 files changed, 1 insertions, 45 deletions
@@ -110,34 +110,12 @@ set_start_script_single() { echo "$VNC_PASSWORD" | vncpasswd -f > /home/kiosk/.vnc/passwd chmod 600 /home/kiosk/.vnc/passwd - # Remove existing VNC server configuration if it exists - sudo systemctl stop x11vnc.service - sudo rm -f /etc/systemd/system/x11vnc.service - cat > /home/kiosk/start.sh <<EOF #!/bin/bash /usr/bin/chromium --no-first-run --disable-translate --no-default-browser-check --disable-cache --kiosk $2 & x11vnc -display :0 -auth guess -forever -rfbport 5901 -passwdfile /home/kiosk/.vnc/passwd & EOF - sudo chmod a+x /home/kiosk/start.sh - - # Create a new VNC server configuration - sudo bash -c "cat > /etc/systemd/system/x11vnc.service << 'EOF' -[Unit] -Description=Start x11vnc at startup. -After=multi-user.target - -[Service] -Type=simple -ExecStart=/usr/bin/x11vnc -display :0 -auth guess -forever -rfbport 5901 -passwdfile /home/kiosk/.vnc/passwd - -[Install] -WantedBy=multi-user.target -EOF" - - sudo systemctl daemon-reload - sudo systemctl enable x11vnc.service - sudo systemctl start x11vnc.service + chmod a+x /home/kiosk/start.sh } # Helper function to configure start.sh for multiple tabs @@ -155,10 +133,6 @@ configure_tabs() { echo "$VNC_PASSWORD" | vncpasswd -f > /home/kiosk/.vnc/passwd chmod 600 /home/kiosk/.vnc/passwd - # Remove existing VNC server configuration if it exists - sudo systemctl stop x11vnc.service - sudo rm -f /etc/systemd/system/x11vnc.service - # Write the script with properly formatted commands cat > /home/kiosk/start.sh <<EOF #!/bin/bash @@ -192,24 +166,6 @@ done x11vnc -display :0 -auth guess -forever -rfbport 5901 -passwdfile /home/kiosk/.vnc/passwd & EOF chmod a+x /home/kiosk/start.sh - - # Create a new VNC server configuration - sudo bash -c "cat > /etc/systemd/system/x11vnc.service << 'EOF' -[Unit] -Description=Start x11vnc at startup. -After=multi-user.target - -[Service] -Type=simple -ExecStart=/usr/bin/x11vnc -display :0 -auth guess -forever -rfbport 5901 -passwdfile /home/kiosk/.vnc/passwd - -[Install] -WantedBy=multi-user.target -EOF" - - sudo systemctl daemon-reload - sudo systemctl enable x11vnc.service - sudo systemctl start x11vnc.service } # Function to edit .bashrc for automatic start of X session |