Skip to content

Instantly share code, notes, and snippets.

@downloadpizza
Last active May 9, 2019 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save downloadpizza/e8e93cfad0697012b7c7f284da306b3d to your computer and use it in GitHub Desktop.
Save downloadpizza/e8e93cfad0697012b7c7f284da306b3d to your computer and use it in GitHub Desktop.
Read my server.sh description, this is a wrapper, which allows control c without killing the script
#!/usr/bin/env bash
trap t_exit INT
function t_exit() {
read -p "Exit? y/N: " ext
if [[ "y" = "$ext" ]];then
exit 1
fi
}
while true
do
./server
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment