linux bash script

36 views
Skip to first unread message

Chuck

unread,
Apr 13, 2010, 8:52:11 PM4/13/10
to MyMedia Roku Developers
Hey all, I wrote the following bash script for use in auto-starting
the roku server on my ubuntu NAS server. I was having a problem
because originally it was just the one line to basically start the
rss_server script, but my machine was hanging on shutdown, and I
realized that it was because the init.d script didn't implement a stop
command, so I stole some code from other scripts in init.d and wrote
the following. works great for me. If I were to do more work on it,
it would be to try to integrate the roku config file, but now that
it's working, I seriously doubt I'll get to it! Too much awesome
local media to enjoy!

Thanks for the great program!


#!/bin/bash
#script to run roku server

ROKUDIR=/home/charlie/netguy204-roku_media_server-25aaa89/server
ROKUSCRIPT=rss_server.py

case "$1" in
start)
cd $ROKUDIR
python $ROKUDIR/$ROKUSCRIPT
;;
stop)
pkill -9 -f rss_server.py || true
;;
restart|force-reload)
$0 stop
$0 start
;;
*)
echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
exit 3
;;
esac

:

Brian Taylor

unread,
Apr 14, 2010, 12:47:57 PM4/14/10
to mymedia-rok...@googlegroups.com
Cool stuff! Thank you.

I'll review it and see if we can make it work for easily for other distros / setups... I actually don't have an init script for my ubuntu server so this will come in handy.


--
You received this message because you are subscribed to the Google Groups "MyMedia Roku Developers" group.
To post to this group, send email to mymedia-rok...@googlegroups.com.
To unsubscribe from this group, send email to mymedia-roku-deve...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mymedia-roku-developers?hl=en.


Reply all
Reply to author
Forward
0 new messages