Merge branch 'vnc' into 'master'

Add dovnc boot option

Closes #228

See merge request systemrescue/systemrescue-sources!113
This commit is contained in:
Francois Dupoux 2021-11-07 10:40:51 +00:00
commit ba5e2c5e61
3 changed files with 24 additions and 2 deletions

View file

@ -1,3 +1,5 @@
#!/bin/bash
[ -f ~/.xprofile ] && . ~/.xprofile
exec /usr/bin/startxfce4

View file

@ -20,7 +20,7 @@ do
# Set the system root password from a clear password
rootpass=*)
echo "Found option 'rootpass=******' on the boot command line"
echo "Found option '${curopt%%=*}=******' on the boot command line"
if echo "root:${curopt#*=}" | chpasswd --crypt-method SHA512
then
echo "Password successfully changed"
@ -34,7 +34,7 @@ do
# A password can be encrypted using a one-line python3 command such as:
# python3 -c 'import crypt; print(crypt.crypt("MyPassWord123", crypt.mksalt(crypt.METHOD_SHA512)))'
rootcryptpass=*)
echo "Found option 'rootcryptpass=******' on the boot command line"
echo "Found option '${curopt%%=*}=******' on the boot command line"
if echo "root:${curopt#*=}" | chpasswd --encrypted
then
echo "Password successfully changed"
@ -63,6 +63,25 @@ do
echo "Found option '${curopt}' on the boot command line"
systemctl revert getty@.service serial-getty@.service
;;
# Set the VNC password from a clear password
vncpass=*)
echo "Found option '${curopt%%=*}=******' on the boot command line"
mkdir -p /root/.vnc
if x11vnc -storepasswd ${curopt#*=} /root/.vnc/passwd
then
echo "VNC password successfully changed"
else
echo "Failed to change VNC password"
errcnt=$((errcnt + 1))
fi
;;
# Auto-start x11vnc with the graphical environment
dovnc)
echo "Found option '${curopt}' on the boot command line"
echo 'x11vnc -nevershared -forever -logfile /var/log/x11vnc.log &' > /root/.xprofile
;;
esac
done

View file

@ -170,6 +170,7 @@ wireless-regdb
wireless_tools
wpa_supplicant
wvdial
x11vnc
xarchiver
xfburn
xfce4