Skip to content

Commit 7f034e4

Browse files
authored
Merge pull request #310 from DL6JJ/patch-2
$FULLPAGEOS_OVERRIDE_PASSWORD overwrite VNC PW
2 parents 111739b + 96ccca5 commit 7f034e4

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

src/modules/fullpageos/start_chroot_script

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,34 @@ fi
8585
#override password
8686
if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" != "default" ]
8787
then
88+
#root password
8889
echo "pi:$FULLPAGEOS_OVERRIDE_PASSWORD" | chpasswd
90+
# Set up x11vnc
91+
sudo -u pi /home/pi/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD"
92+
if [ ! -f /home/pi/.vnc/passwd ]; then
93+
echo "/home/pi/.vnc/passwd was not created. Trying again."
94+
sudo -u pi /home/pi/scripts/setX11vncPass "$FULLPAGEOS_OVERRIDE_PASSWORD"
95+
if [ ! -f /home/pi/.vnc/passwd ]; then
96+
echo "/home/pi/.vnc/passwd was not created again. Giving up."
97+
echo "Failed to set a VNC password. Aborting build."
98+
exit 1
99+
fi
100+
fi
89101
fi
90102

91-
# Set up x11vnc
92-
sudo -u pi /home/pi/scripts/setX11vncPass raspberry
93-
if [ ! -f /home/pi/.vnc/passwd ]; then
94-
echo "/home/pi/.vnc/passwd was not created. Trying again."
95-
sudo -u pi /home/pi/scripts/setX11vncPass raspberry
96-
if [ ! -f /home/pi/.vnc/passwd ]; then
97-
echo "/home/pi/.vnc/passwd was not created again. Giving up."
98-
echo "Failed to set a VNC password. Aborting build."
99-
exit 1
100-
fi
103+
if [ "$FULLPAGEOS_OVERRIDE_PASSWORD" == "default" ]
104+
then
105+
# Set up x11vnc
106+
sudo -u pi /home/pi/scripts/setX11vncPass raspberry
107+
if [ ! -f /home/pi/.vnc/passwd ]; then
108+
echo "/home/pi/.vnc/passwd was not created. Trying again."
109+
sudo -u pi /home/pi/scripts/setX11vncPass raspberry
110+
if [ ! -f /home/pi/.vnc/passwd ]; then
111+
echo "/home/pi/.vnc/passwd was not created again. Giving up."
112+
echo "Failed to set a VNC password. Aborting build."
113+
exit 1
114+
fi
115+
fi
101116
fi
102117

103118
#echo "sudo -u pi startx /home/pi/scripts/run_onepageos &" >> /etc/rc.local

0 commit comments

Comments
 (0)