I have terminal linux server (xrdp) and I need a script that will terminate the session and send the user to the login screen after completing the rdp connection
OS: CentOS 8
I wrote this, but i sense i need something more
#!/bin/bash
if
xfreerdp /v:"my-IP" /u:"my-user" /p:"pass" -f
else
gnome-session-quit
fi
The idea is this: The user starts his computer, logs into his account, the script runs automatically and connects it to the rdp session on the server. After the user finishes working, he completes the connection and the script sends it to the login screen. In fact, the user has little interaction with the installed OS on the computer
Try with:
#!/bin/bash
xfreerdp /v:"my-IP" /u:"my-user" /p:"pass" -f
wait
gnome-session-quit
Explanation: the wait
bash command waits for each just spawned processes to terminate, then goes on with the execution of the next instructions.
4