Skip to content

Instantly share code, notes, and snippets.

@alunny
Created February 25, 2012 03:33
Show Gist options
  • Save alunny/1905890 to your computer and use it in GitHub Desktop.
Save alunny/1905890 to your computer and use it in GitHub Desktop.
# for good measure
@daily /etc/init.d/weinred restart
#!/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