#!/bin/bash

# Saves the PID's to kill them #
var="$(ps ax | grep 'ngrok\|receive\|brew' | awk '{ print $1 }' | tr '\n' ' ')"
$(sudo kill -s SIGKILL $var)

# Removes the named pipes #
rm pipe1 pipe2

# Appends to files to designate the end of the log #
echo "----------------- END OF SERVER RUN -----------------" >> serv.log
echo "----------------- END OF NGROK RUN ------------------" >> ngrok.log

# Displays on screen what the script did #
echo "Killed python server"
echo "Killed ngrok port service"
echo "Killed coffee program"
echo "Removed named pipes"