Skip to content

Instantly share code, notes, and snippets.

@ryross
Forked from ruudud/buster-phantom.sh
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryross/c3dc784bcad0c08293c3 to your computer and use it in GitHub Desktop.
Save ryross/c3dc784bcad0c08293c3 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Depends on phantom.js being installed
#
PHANTOM_CMD="phantomjs"
command -v $PHANTOM_CMD > /dev/null || { echo "Phantomjs not found"; exit 1; }
get_phantom_pid (){
echo `ps aux|grep $PHANTOM_CMD|grep buster|awk '{ print $2 }'`
}
case "$1" in
"start")
echo "Starting phantomjs"
phantomjs --webdriver=4445 --ignore-ssl-errors=true &>/dev/null &
;;
"stop")
echo "Killing phantomjs server"
kill `get_phantom_pid`
;;
*)
echo "Usage:
$0 start|stop"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment