Skip to content

Instantly share code, notes, and snippets.

@ryross ryross/phantom.sh forked from ruudud/buster-phantom.sh
Last active Aug 29, 2015

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.