Created
February 25, 2012 03:33
-
-
Save alunny/1905890 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# for good measure | |
@daily /etc/init.d/weinred restart |
This file contains hidden or 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 | |
# | |
# weinred Start up the Weinre server daemon | |
TWO="$2" | |
WEINRE_PATH=/home/ec2-user/weinre/current/bin/weinre.jar | |
LOG_PATH=/home/ec2-user/log/weinre.log | |
HTTPPORT="--httpPort 80" | |
BOUNDHOST="--boundHost -all-" | |
VERBOSE="--verbose true" | |
start() | |
{ | |
if [ "$TWO" = "verbose" ] | |
then | |
echo -n "Starting weinre with verbose logging" | |
java -jar $WEINRE_PATH $HTTPPORT $BOUNDHOST $VERBOSE > $LOG_PATH 2>&1 < /dev/null & | |
else | |
echo -n "Starting weinre" | |
java -jar $WEINRE_PATH $HTTPPORT $BOUNDHOST > $LOG_PATH 2>&1 < /dev/null & | |
fi | |
echo | |
} | |
stop() | |
{ | |
echo -n "Stopping weinre" | |
pkill -f "java.*weinre" | |
echo | |
} | |
restart() { | |
stop | |
start | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
restart) | |
restart | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment