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
#!/usr/bin/env bash | |
set -x | |
term_handler() { | |
echo "Stopping the server process with PID $PID" | |
erl -noshell -name "term@127.0.0.1" -eval "rpc:call('app@127.0.0.1', init, stop, [])" -s init stop | |
echo "Stopped" | |
} | |
trap 'term_handler' TERM INT |