2014-07-07 08:52:47 +00:00
|
|
|
#!/bin/sh
|
|
|
|
PRG="$0"
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# make it fully qualified
|
|
|
|
WORKING_DIR=`pwd`
|
|
|
|
PRG_DIR=`dirname "$PRG"`
|
|
|
|
APP_ROOT=`cd "$PRG_DIR" && pwd`
|
|
|
|
|
|
|
|
# restore original working dir
|
|
|
|
cd "$WORKING_DIR"
|
|
|
|
|
2015-06-07 19:14:33 +00:00
|
|
|
# make sure required environment variables are set
|
|
|
|
if [ -z "$USER" ]
|
|
|
|
then
|
|
|
|
export USER=`whoami`
|
|
|
|
fi
|
|
|
|
|
2015-03-27 16:03:53 +00:00
|
|
|
# user per user app data location to avoid permission conflicts between root and admin users
|
|
|
|
APP_DATA="$APP_ROOT/data/$USER"
|
|
|
|
|
2015-03-24 18:04:32 +00:00
|
|
|
# add 3rd party packages to the library path by default
|
2015-06-03 19:27:30 +00:00
|
|
|
SYNO_FPCALC="/usr/local/chromaprint/bin/fpcalc"
|
2015-03-30 13:09:22 +00:00
|
|
|
SYNO_LIBRARY_PATH="/usr/local/mediainfo/lib"
|
2014-07-07 08:52:47 +00:00
|
|
|
|
2014-07-08 06:23:33 +00:00
|
|
|
# add APP_ROOT to LD_LIBRARY_PATH
|
|
|
|
if [ ! -z "$LD_LIBRARY_PATH" ]
|
|
|
|
then
|
2015-03-25 18:06:12 +00:00
|
|
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SYNO_LIBRARY_PATH:$APP_ROOT"
|
2014-07-08 06:23:33 +00:00
|
|
|
else
|
2015-03-25 18:06:12 +00:00
|
|
|
export LD_LIBRARY_PATH="$SYNO_LIBRARY_PATH:$APP_ROOT"
|
2014-07-08 06:23:33 +00:00
|
|
|
fi
|
|
|
|
|
2014-07-07 08:52:47 +00:00
|
|
|
# force JVM language and encoding settings
|
2014-10-26 17:48:52 +00:00
|
|
|
export LANG="en_US.UTF-8"
|
|
|
|
export LC_ALL="en_US.UTF-8"
|
2014-07-07 08:52:47 +00:00
|
|
|
|
2015-06-04 10:41:43 +00:00
|
|
|
# FileBot settings
|
|
|
|
# EXTRACTOR="SevenZipNativeBindings" # use the lib7-Zip-JBinding.so native library
|
|
|
|
# EXTRACTOR="SevenZipExecutable" # use the 7z executable
|
|
|
|
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
|
|
|
|
|
|
|
|
java -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding="UTF-8" -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=spk -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Dnet.filebot.AcoustID.fpcalc="$SYNO_FPCALC" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/temp" -Duser.home="$APP_DATA" -Djava.util.prefs.PreferencesFactory=net.filebot.util.prefs.FilePreferencesFactory -Dnet.filebot.util.prefs.file="$APP_DATA/prefs.properties" -jar "$APP_ROOT/FileBot.jar" "$@"
|