Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIR=<WORKING_DIRECTORY>
- PROCESS=<PROCESS_EXECUTABLE>
- FULL_PROCESS=$DIR/$PROCESS
- GET_PID="pidof -s $FULL_PROCESS"
- echo -n "Stopping \"$PROCESS\".."
- PID="$($GET_PID)"
- if [ $? -ne 0 ]; then
- echo ". failed (not running)."
- exit 1
- else
- kill $PID > /dev/null
- $GET_PID > /dev/null
- while [ $? -eq 0 ]
- do
- echo -n "."
- sleep 1
- $GET_PID > /dev/null
- done
- echo ". done (PID = $PID)."
- exit 0
- fi
Add Comment
Please, Sign In to add comment