Untitled

 avatar
unknown
plain_text
a year ago
323 B
6
Indexable
# Get ports of xvnc
ports=($(ss -lptn | grep Xvnc | awk '{split($4, a, ":"); print a[2]}'))

if [[ ${#ports[@]} =~ "$2" ]]; then
	read -p "Port $2 is in use. Do you want to connect to existing session? (Y/n)" answer
	if [[ $answer == "yes" ]]; then
		echo "IMPLEMENT CREATING XVNC"
	else
		echo ":o"
	fi
else
	echo ":oo"
fi
Editor is loading...
Leave a Comment