2018-07-04 11:15:07 -04:00
|
|
|
#!/bin/sh
|
2018-07-09 15:24:09 -04:00
|
|
|
CONF="/etc/config/qpkg.conf"
|
|
|
|
QPKG_NAME="filebot"
|
|
|
|
QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f $CONF`
|
|
|
|
|
2018-07-04 11:15:07 -04:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2018-07-09 15:24:09 -04:00
|
|
|
ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
|
|
|
|
if [ "$ENABLED" != "TRUE" ]; then
|
|
|
|
echo "$QPKG_NAME is disabled."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-07-10 01:47:45 -04:00
|
|
|
/bin/ln -sf "$QPKG_ROOT/filebot.sh" "/usr/bin/filebot"
|
|
|
|
/bin/ln -sf "$QPKG_ROOT" "/opt/filebot"
|
|
|
|
;;
|
2018-07-04 11:15:07 -04:00
|
|
|
|
|
|
|
stop)
|
2018-07-10 01:47:45 -04:00
|
|
|
rm -rf "/usr/bin/filebot"
|
|
|
|
rm -rf "/opt/filebot"
|
|
|
|
;;
|
2018-07-04 11:15:07 -04:00
|
|
|
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
$0 start
|
2018-07-10 01:47:45 -04:00
|
|
|
;;
|
2018-07-04 11:15:07 -04:00
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
|
2018-07-09 15:24:09 -04:00
|
|
|
|
2018-07-04 11:15:07 -04:00
|
|
|
exit 0
|