2014-07-07 04:52:47 -04:00
|
|
|
#!/bin/sh
|
2015-02-23 02:02:25 -05:00
|
|
|
|
|
|
|
# symlink to /bin on START and unlink on STOP
|
|
|
|
FILEBOT_BINARY="/usr/syno/bin/filebot"
|
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
# When the user clicks the button "Run" to run the package, after the package is installed, or when the DiskStation is turned on.
|
|
|
|
ln -s "$SYNOPKG_PKGDEST/filebot.sh" "$FILEBOT_BINARY"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
|
|
|
# When the user clicks the button "Stop" to stop the running package, before the package is uninstalled, or when the DiskStation is turned off.
|
|
|
|
rm -f "$FILEBOT_BINARY"
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
|
|
|
|
status)
|
|
|
|
# When Package Center is opened to check package status, the Center will send a request to ask the status of the package with this parameter.
|
|
|
|
if [ -e "$FILEBOT_BINARY" ]; then
|
|
|
|
# 0: package is running
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
# 3: package is not running
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2015-02-23 02:56:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
# return successfully
|
|
|
|
exit 0
|