From fe9a7529d077df4e84b612acd3feed29c51be964 Mon Sep 17 00:00:00 2001 From: DL6JJ | Jay Date: Thu, 19 Dec 2019 09:30:57 +0100 Subject: [PATCH 1/2] $FULLPAGEOS_OVERRIDE_PASSWORD overwrite VNC PW $FULLPAGEOS_OVERRIDE_PASSWORD will now also overwrite the VNC Password as well as the user password. --- src/modules/fullpageos/start_chroot_script | 35 +++++++++++++++------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/modules/fullpageos/start_chroot_script b/src/modules/fullpageos/start_chroot_script index 029921f..19889ea 100755 --- a/src/modules/fullpageos/start_chroot_script +++ b/src/modules/fullpageos/start_chroot_script @@ -85,19 +85,34 @@ fi #override password if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" != "default" ] then + #root password echo "pi:$FULLPAGEOS_OVERRIDE_PASSWORD" | chpasswd + # Set up x11vnc + sudo -u pi /home/pi/scripts/setX11vncPass $FULLPAGEOS_OVERRIDE_PASSWORD + if [ ! -f /home/pi/.vnc/passwd ]; then + echo "/home/pi/.vnc/passwd was not created. Trying again." + sudo -u pi /home/pi/scripts/setX11vncPass $FULLPAGEOS_OVERRIDE_PASSWORD + if [ ! -f /home/pi/.vnc/passwd ]; then + echo "/home/pi/.vnc/passwd was not created again. Giving up." + echo "Failed to set a VNC password. Aborting build." + exit 1 + fi + fi fi -# Set up x11vnc -sudo -u pi /home/pi/scripts/setX11vncPass raspberry -if [ ! -f /home/pi/.vnc/passwd ]; then - echo "/home/pi/.vnc/passwd was not created. Trying again." - sudo -u pi /home/pi/scripts/setX11vncPass raspberry - if [ ! -f /home/pi/.vnc/passwd ]; then - echo "/home/pi/.vnc/passwd was not created again. Giving up." - echo "Failed to set a VNC password. Aborting build." - exit 1 - fi +if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" == "default" ] +then + # Set up x11vnc + sudo -u pi /home/pi/scripts/setX11vncPass raspberry + if [ ! -f /home/pi/.vnc/passwd ]; then + echo "/home/pi/.vnc/passwd was not created. Trying again." + sudo -u pi /home/pi/scripts/setX11vncPass raspberry + if [ ! -f /home/pi/.vnc/passwd ]; then + echo "/home/pi/.vnc/passwd was not created again. Giving up." + echo "Failed to set a VNC password. Aborting build." + exit 1 + fi + fi fi #echo "sudo -u pi startx /home/pi/scripts/run_onepageos &" >> /etc/rc.local From 96ccca5fc07c4dacd9d9dbbe3e25d4204a1497df Mon Sep 17 00:00:00 2001 From: DL6JJ | Jay Date: Thu, 19 Dec 2019 10:08:35 +0100 Subject: [PATCH 2/2] Added " to $FULLPAGEOS_OVERRIDE_PASSWORD Now passwords with spaces etc. can be handled --- src/modules/fullpageos/start_chroot_script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/fullpageos/start_chroot_script b/src/modules/fullpageos/start_chroot_script index 19889ea..15fbe7d 100755 --- a/src/modules/fullpageos/start_chroot_script +++ b/src/modules/fullpageos/start_chroot_script @@ -88,10 +88,10 @@ then #root password echo "pi:$FULLPAGEOS_OVERRIDE_PASSWORD" | chpasswd # Set up x11vnc - sudo -u pi /home/pi/scripts/setX11vncPass $FULLPAGEOS_OVERRIDE_PASSWORD + sudo -u pi /home/pi/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD" if [ ! -f /home/pi/.vnc/passwd ]; then echo "/home/pi/.vnc/passwd was not created. Trying again." - sudo -u pi /home/pi/scripts/setX11vncPass $FULLPAGEOS_OVERRIDE_PASSWORD + sudo -u pi /home/pi/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD" if [ ! -f /home/pi/.vnc/passwd ]; then echo "/home/pi/.vnc/passwd was not created again. Giving up." echo "Failed to set a VNC password. Aborting build."