#!/bin/sh


start() {
	/usr/bin/python /usr/local/bin/storemyip.py > /dev/null &
	echo 'storemyip started!'
}

stop() {
	pid=`ps -ef | grep '[p]ython /usr/local/bin/storemyip.py' | awk '{ print $2 }'`
	kill $pid
	echo 'storemyip killed! pid='$pid
}

case $1 in
	start)
		start
		;;
	stop)
		stop
		;;
	restart)
		stop
		start
		;;
	*)
		echo 'Usage: storemyip.py { | start | stop | restart}'
		exit 1
esac
exit 0