Last active
April 8, 2019 03:29
-
-
Save metalefty/2672c26ae0cb36f7a4bc100650c83a15 to your computer and use it in GitHub Desktop.
Clean up remained xrdp socket files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SOCKDIR=/tmp/.xrdp | |
SESSIONS=$(cd ${SOCKDIR} ; ls -1 xrdp_* | sed -e 's|[^0-9]||g' | sort -u) | |
for i in ${SESSIONS} | |
do | |
if [ ! -S ${SOCKDIR}/xrdp_display_${i} ] | |
then | |
( | |
cd ${SOCKDIR} | |
rm -f xrdp_chansrv_audio_in_socket_${i} \ | |
xrdp_chansrv_audio_out_socket_${i} \ | |
xrdp_chansrv_socket_${i} \ | |
xrdpapi_${i} | |
) | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The SESSIONS line can be written like this.