Untitled
unknown
plain_text
2 years ago
571 B
11
Indexable
#!/bin/bash
if (($# != 3))
then
echo "Usage: raat-server [vnc password] [rfb port] [geometry]"
exit 1
fi
# Get ports of xvnc
ports=($(ss -lptn | grep Xvnc | awk '{split($4, a, ":"); print a[2]}'))
if [ ${#ports[@]} -eq 0 ]; then
display=$(($2-5900))
mkdir -p ~/.vnc && touch ~/.vnc/$2.passwd
echo $1 | vncpasswd -f > ~/.vnc/$2.passwd
Xvnc -geometry $3 -SecurityTypes=None :$display &
DISPLAY=:$display startlxde &
vncviewer -passwd ~/.vnc/$2.passwd 0.0.0.0:$2
else
echo "There is/are active session/s:"
for port in "${ports[@]}"; do
echo "- $port"
done
fiEditor is loading...
Leave a Comment