2019-07-15 17:55:54 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
USER=$(whoami)
|
|
|
|
|
|
|
|
# get new display
|
|
|
|
DISPLAY=0
|
|
|
|
for file in /var/lib/vnc/* ; do
|
|
|
|
if [ $(cat $file) -gt $DISPLAY ] ; then
|
|
|
|
DISPLAY=$(cat $file)
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
let "DISPLAY++"
|
|
|
|
|
|
|
|
# add user file
|
|
|
|
echo "$DISPLAY" > /var/lib/vnc/${USER}
|
|
|
|
chmod 644 /var/lib/vnc/${USER}
|
|
|
|
|
|
|
|
/usr/local/bin/startvnc
|
2019-07-16 17:50:29 +00:00
|
|
|
|
|
|
|
PORT=$((DISPLAY + 5900))
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Your port number is ${PORT}; please note it down."
|
|
|
|
echo "You might like to see https://wiki.thunix.net/wiki/vnc for further information."
|