28 lines
523 B
Bash
Executable File
28 lines
523 B
Bash
Executable File
#!/bin/bash
|
|
|
|
function helpexit() {
|
|
echo "start a VNC session"
|
|
exit
|
|
}
|
|
[[ "$1" = "-h" ]] && helpexit
|
|
|
|
dn=$(( 5900 + $UID % 40000 ))
|
|
|
|
vncserver :$dn -depth 24 \
|
|
-geometry 1024x768 \
|
|
-geometry 800x600 \
|
|
-geometry 1280x720 \
|
|
-geometry 1366x768 \
|
|
-geometry 1680x1050 \
|
|
-geometry 1920x1080 \
|
|
-geometry 1920x1200 \
|
|
-geometry 2560x1440 \
|
|
-geometry 2560x1600 \
|
|
-localhost \
|
|
-rfbport $dn
|
|
ec=$?
|
|
echo "Kill with vnckill"
|
|
echo "use vncdisp to change resolution"
|
|
echo Your VNC connection port is $HOSTNAME:$dn
|
|
exit $ec
|