Script remote desktop
#!/bin/bash # Loop without an end while : do # For details see man of rdesktop rdesktop -f -z -a 24 -x broadband -k de -r sound:local -u "UUSER" -p "PASSWORD" 172.17.112.17 # After disconnect check for xsession lxalive=$(ps -ae|grep lxsession); # Do $lxalive exists? if [ ! -n "$lxalive" ]; then # You have to do init 0 with sudo, because you are logged in as user pi sudo init 0 fi #EndIf done # End Loop