This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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