Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,20 @@ rm -f $IN_PIPE;
mkfifo $IN_PIPE;

# run the server
cat $WS_PIPE | ./pipe_to_websocket.sh $IN_PIPE | nc -l -p $SERVER_PORT > $WS_PIPE &
cat $WS_PIPE | $(realpath "$(dirname "${BASH_SOURCE[0]}")")/pipe_to_websocket.sh $IN_PIPE | nc -l -p $SERVER_PORT > $WS_PIPE &
serverpid=$!

sig_handler() {
printf "\nProcess interrupted. Exiting PID %d\n" $serverpid
kill $serverpid
exit 0
}

trap sig_handler SIGHUP SIGKILL SIGINT SIGSTOP

# input loop
while read line
do
echo "$line" >> $IN_PIPE;
done

kill $serverpid