Skip to content

Instantly share code, notes, and snippets.

@munky69rock
Created July 10, 2017 09:29
Show Gist options
  • Select an option

  • Save munky69rock/154e7b9945e9a40c68e520c0682f8c09 to your computer and use it in GitHub Desktop.

Select an option

Save munky69rock/154e7b9945e9a40c68e520c0682f8c09 to your computer and use it in GitHub Desktop.
Simple Process Watcher
#!/bin/bash
set -ue
keyword="$1"
time=${2:-60}
while test -n "$(ps aufx | grep $keyword | grep -v grep | grep -v $0)"; do
sleep $time
done
echo done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment