2012-09-18 13:47:01 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: mylar
|
|
|
|
# Required-Start: $local_fs $network $remote_fs
|
|
|
|
# Required-Stop: $local_fs $network $remote_fs
|
|
|
|
# Should-Start: $NetworkManager
|
|
|
|
# Should-Stop: $NetworkManager
|
|
|
|
# Default-Start: 2 3 4 5
|
|
|
|
# Default-Stop: 0 1 6
|
|
|
|
# Short-Description: starts instance of mylar
|
|
|
|
# Description: starts instance of mylar using start-stop-daemon
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
############### EDIT ME ##################
|
|
|
|
# path to app
|
|
|
|
APP_PATH=
|
|
|
|
|
|
|
|
# path to python bin
|
|
|
|
DAEMON=/usr/bin/python
|
|
|
|
|
|
|
|
# startup args
|
|
|
|
DAEMON_OPTS=" Mylar.py -q"
|
|
|
|
|
|
|
|
# script name
|
|
|
|
NAME=mylar
|
|
|
|
|
|
|
|
# app name
|
|
|
|
DESC=mylar
|
|
|
|
|
|
|
|
# user
|
|
|
|
RUN_AS=
|
|
|
|
|
|
|
|
PID_FILE=/var/run/mylar.pid
|
2013-10-19 01:04:16 +00:00
|
|
|
PID_PATH=`dirname $PID_FILE`
|
2012-09-18 13:47:01 +00:00
|
|
|
|
|
|
|
############### END EDIT ME ##################
|
|
|
|
|
|
|
|
test -x $DAEMON || exit 0
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2013-10-19 01:04:16 +00:00
|
|
|
# Create PID if missing and remove stale PID file
|
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
|
|
|
if [ ! -d $PID_PATH ]; then
|
2013-10-19 01:04:16 +00:00
|
|
|
mkdir -p $PID_PATH
|
|
|
|
chown $RUN_AS $PID_PATH
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -e $PID_FILE ]; then
|
|
|
|
PID=`cat $PID_FILE`
|
|
|
|
if ! kill -0 $PID > /dev/null 2>&1; then
|
|
|
|
echo "Removing stale $PID_FILE"
|
|
|
|
rm $PID_FILE
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-09-18 13:47:01 +00:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo "Starting $DESC"
|
|
|
|
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
echo "Stopping $DESC"
|
|
|
|
start-stop-daemon --stop --pidfile $PID_FILE
|
|
|
|
;;
|
|
|
|
|
|
|
|
restart|force-reload)
|
|
|
|
echo "Restarting $DESC"
|
|
|
|
start-stop-daemon --stop --pidfile $PID_FILE
|
|
|
|
sleep 15
|
|
|
|
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --background --pidfile $PID_FILE --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
N=/etc/init.d/$NAME
|
|
|
|
echo "Usage: $N {start|stop|restart|force-reload}" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|