Skip to content

Instantly share code, notes, and snippets.

@matipan
Created February 12, 2016 02:35
Show Gist options
  • Save matipan/58ce0744ee0ac75e3315 to your computer and use it in GitHub Desktop.
Save matipan/58ce0744ee0ac75e3315 to your computer and use it in GitHub Desktop.
#!/bin/bash
count=0
while true; do
if [ `ps -e | grep postgres | wc -l` -ge 1 ]; then
let count++
echo "Encontro"
if [ $count -eq 10 ]; then
echo "LISTO"
sudo killall postgres
exit 50
fi
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment