Script remote desktop

From
Jump to: navigation, search

in /home/pi/config/autostart

[Desktop Entry]
Name=Autostart-Script
Comment=Kommentar
Type=Application
Exec=/home/pi/startrdp.sh
Terminal=false


in Datei /home/pi/startrdp.sh:

#!/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