1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00
filebot/installer/qpkg/shared/filebot-service.sh

36 lines
570 B
Bash
Raw Normal View History

2018-07-04 11:15:07 -04:00
#!/bin/sh
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)
ENABLED=$(/sbin/getcfg $QPKG_NAME Enable -u -d FALSE -f $CONF)
if [ "$ENABLED" != "TRUE" ]; then
echo "$QPKG_NAME is disabled."
exit 1
fi
/bin/ln -sf "$QPKG_ROOT/bin/filebot.sh" "/usr/bin/filebot"
/bin/ln -sf "$QPKG_ROOT" "/opt/filebot"
;;
2018-07-04 11:15:07 -04:00
stop)
rm -rf "/usr/bin/filebot"
rm -rf "/opt/filebot"
;;
2018-07-04 11:15:07 -04:00
restart)
$0 stop
$0 start
;;
2018-07-04 11:15:07 -04:00
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
2018-07-04 11:15:07 -04:00
exit 0