How to restart the rport client safely when connected via tunnel
Problem
You want to restart the rport client, but you are connected via a tunnel (RDP, VNC or SSH). If you just execute a restart command, you will kill the current connection and the restart is also killed halfway. The client will not reconnect.
Solution
You must restart the client with a small delay from a background process. This is done best from the rport script interface.
On Linux
On Linux, execute the following script:
rport restart
if [ "$(id-u)"-ne0 ];thenecho"Not root. Please enable sudo";exit1fiifwhichat>/dev/null2>&1; thenecho"$RESTART_CMD"|atnow+1minuteecho"Restart of rport scheduled via atd."elsenohupsh-c"sleep 10;$RESTART_CMD">/dev/null2>&1&echo"Restart of rport scheduled via nohup+sleep."fi
Make sure, you enable sudo.
On Windows
On Windows, a few more lines of PowerShell are required to execute a task in the background. Execute the following script to safely restart rport.