From f4538acb5e4a7400abe767cd8c19792526c21332 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 10 Jul 2018 14:23:38 +0700 Subject: [PATCH] QPKG_SERVICE_PROGRAM must be a unique name (least it overrides other startup scripts in /etc/init.d) --- installer/qpkg/makefile | 3 -- installer/qpkg/shared/{ => bin}/filebot.sh | 33 ++++------------------ installer/qpkg/shared/filebot-service.sh | 2 +- 3 files changed, 7 insertions(+), 31 deletions(-) rename installer/qpkg/shared/{ => bin}/filebot.sh (58%) diff --git a/installer/qpkg/makefile b/installer/qpkg/makefile index 88a0bca1..c4b52f5c 100644 --- a/installer/qpkg/makefile +++ b/installer/qpkg/makefile @@ -5,10 +5,7 @@ ICON := ../icons/filebot.svg resize-icons: - # QPKG ICONS convert -verbose $(ICON) -resize 64x64 -gravity center -background transparent -extent 64x64 icons/$(QPKG_NAME).png convert -verbose $(ICON) -resize 64x64 -gravity center -background transparent -extent 64x64 -colorspace gray icons/$(QPKG_NAME)_gray.png convert -verbose $(ICON) -resize 80x80 -gravity center -background transparent -extent 80x80 icons/$(QPKG_NAME)_80.png - - # REPOSITORY ICONS convert -verbose $(ICON) -resize 100x100 -gravity center -background transparent -extent 100x100 icons/$(QPKG_NAME)_100.png diff --git a/installer/qpkg/shared/filebot.sh b/installer/qpkg/shared/bin/filebot.sh similarity index 58% rename from installer/qpkg/shared/filebot.sh rename to installer/qpkg/shared/bin/filebot.sh index f4ad219b..94614d34 100755 --- a/installer/qpkg/shared/filebot.sh +++ b/installer/qpkg/shared/bin/filebot.sh @@ -1,29 +1,8 @@ #!/bin/sh -PRG="$0" +CONF="/etc/config/qpkg.conf" +QPKG_NAME="filebot" +QPKG_ROOT=$(/sbin/getcfg $QPKG_NAME Install_Path -f $CONF) -# resolve relative symlinks -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG="`dirname "$PRG"`/$link" - fi -done - -# get canonical path -WORKING_DIR=`pwd` -PRG_DIR=`dirname "$PRG"` -FILEBOT_HOME=`cd "$PRG_DIR" && pwd` - - -# restore original working dir (which may be /root and yield permission denied) -if [ -x "$WORKING_DIR" ]; then - cd "$WORKING_DIR" -else - cd "$FILEBOT_HOME/../.." # System Volume Path (e.g. /share/CACHEDEV1_DATA) -fi # make sure required environment variables are set if [ -z "$USER" ]; then @@ -47,8 +26,8 @@ MEDIA_PARSER="libmediainfo" # use libmediainfo FFPROBE="/mnt/ext/opt/medialibrary/bin/ffprobe" # select application data folder -APP_DATA="$FILEBOT_HOME/data/$USER" -LIBRARY_PATH="$FILEBOT_HOME/lib/$(uname -m)" +APP_DATA="$QPKG_ROOT/data/$USER" +LIBRARY_PATH="$QPKG_ROOT/lib/$(uname -m)" # start filebot -java -Dapplication.deployment=qpkg -Dnet.filebot.media.parser="$MEDIA_PARSER" -Dnet.filebot.media.ffprobe="$FFPROBE" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djava.awt.headless=true @{java.application.options} @{linux.application.options} @{linux.portable.application.options} $JAVA_OPTS $FILEBOT_OPTS -jar "$FILEBOT_HOME/jar/filebot.jar" "$@" +java -Dapplication.deployment=qpkg -Dnet.filebot.media.parser="$MEDIA_PARSER" -Dnet.filebot.media.ffprobe="$FFPROBE" -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Djava.awt.headless=true @{java.application.options} @{linux.application.options} @{linux.portable.application.options} $JAVA_OPTS $FILEBOT_OPTS -jar "$QPKG_ROOT/jar/filebot.jar" "$@" diff --git a/installer/qpkg/shared/filebot-service.sh b/installer/qpkg/shared/filebot-service.sh index 0714d9ca..fd32e722 100755 --- a/installer/qpkg/shared/filebot-service.sh +++ b/installer/qpkg/shared/filebot-service.sh @@ -1,7 +1,7 @@ #!/bin/sh CONF="/etc/config/qpkg.conf" QPKG_NAME="filebot" -QPKG_ROOT=`/sbin/getcfg $QPKG_NAME Install_Path -f $CONF` +QPKG_ROOT=$(/sbin/getcfg $QPKG_NAME Install_Path -f $CONF) case "$1" in