Created
October 7, 2014 16:09
-
-
Save jbohren/adb4a278f8da3201a7c7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# Wrapper script | |
SCREEN_NAME=RTTLUA | |
screen -dmS $SCREEN_NAME rttlua "$@" | |
SCREEN_ID=$(screen -list | grep $SCREEN_NAME | head -n 1 | awk '{print $1}') | |
cleanup() | |
{ | |
screen -S $SCREEN_ID -p 0 -X stuff "" | |
} | |
trap cleanup SIGINT | |
#wait $SCREEN_PID (won't work snce it's not a child process) | |
while screen -list | grep -q $SCREEN_ID | |
do | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment