Update filebot.sh with $APP_DATA must be writable sanity checks

This commit is contained in:
Reinhard Pointner 2016-03-06 15:32:30 +00:00
parent 5156a0f042
commit 139e3eef6c
6 changed files with 115 additions and 86 deletions

View File

@ -3,16 +3,16 @@ 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
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
# get canonical path
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR/../.." && pwd`
@ -20,4 +20,5 @@ APP_ROOT=`cd "$PRG_DIR/../.." && pwd`
# restore original working dir
cd "$WORKING_DIR"
# start filebot
/usr/libexec/java_home --failfast --version '1.8+' --exec java $JAVA_OPTS -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapple.awt.UIElement=true -Djna.nounpack=true -Dapplication.deployment=app "-Djna.library.path=$APP_ROOT/Contents/MacOS" "-Djava.library.path=$APP_ROOT/Contents/MacOS" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/Contents/MacOS/fpcalc" -jar "$APP_ROOT"/Contents/Java/FileBot*.jar "$@"

View File

@ -1,20 +1,25 @@
#!/bin/sh
APP_ROOT="/usr/share/filebot"
if [ ! -w "$HOME" ]; then
echo '$HOME must be set and writable'
if [ -z "$HOME" ]; then
echo '$HOME must be set'
exit 1
fi
# prepare filebot java call
APP_ROOT="/usr/share/filebot"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
# create application data folder
APP_DATA="$HOME/.filebot"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
mkdir -p "$APP_DATA"
if [ ! -w "$APP_DATA" ]; then
echo "$APP_DATA must be set and writable"
exit 1
fi
java $JAVA_OPTS -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=deb "-Dapplication.dir=$APP_DATA" "-Djava.io.tmpdir=$APP_DATA/temp" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/fpcalc" -jar "$APP_ROOT/FileBot.jar" "$@"

View File

@ -1,30 +1,35 @@
#!/bin/sh
APP_ROOT="/opt/share/filebot"
# make sure required environment variables are set
if [ -z "$USER" ]
then
export USER=`whoami`
fi
APP_ROOT="/opt/share/filebot"
APP_DATA="$APP_ROOT/data/$USER"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
if [ -z "$USER" ]; then
export USER=`whoami`
fi
# force JVM language and encoding settings
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# 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
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
# choose extractor
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable" # use the 7z executable
# EXTRACTOR="SevenZipNativeBindings" # use the lib7-Zip-JBinding.so native library
# create application data folder
APP_DATA="$APP_ROOT/data/$USER"
mkdir -p "$APP_DATA"
if [ ! -w "$APP_DATA" ]; then
echo "$APP_DATA must be set and writable"
exit 1
fi
# start filebot
java $JAVA_OPTS -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Dapplication.deployment=ipkg -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Dnet.filebot.AcoustID.fpcalc="fpcalc" -Dapplication.dir="$APP_DATA" -Djava.io.tmpdir="$APP_DATA/temp" -Duser.home="$APP_DATA" -jar "$APP_ROOT/FileBot.jar" "$@"

View File

@ -12,7 +12,7 @@ while [ -h "$PRG" ] ; do
fi
done
# make it fully qualified
# get canonical path
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`
@ -20,24 +20,40 @@ APP_ROOT=`cd "$PRG_DIR" && pwd`
# restore original working dir
cd "$WORKING_DIR"
# user per user app data location to avoid permission conflicts between root and admin users
APP_DATA="$APP_ROOT/data/$USER"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
# make sure required environment variables are set
if [ -z "$USER" ]; then
export USER=`whoami`
fi
# force JVM language and encoding settings
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# 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
# add 3rd party packages to the library path by default
SYNO_FPCALC="/usr/local/chromaprint/bin/fpcalc"
SYNO_LIBRARY_PATH="/usr/local/mediainfo/lib:/usr/local/chromaprint/lib"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SYNO_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$SYNO_LIBRARY_PATH:$APP_ROOT"
fi
# choose extractor
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable" # use the 7z executable
# EXTRACTOR="SevenZipNativeBindings" # use the lib7-Zip-JBinding.so native library
# create application data folder
APP_DATA="$APP_ROOT/data/$USER"
mkdir -p "$APP_DATA"
if [ ! -w "$APP_DATA" ]; then
echo "$APP_DATA must be set and writable"
exit 1
fi
# start filebot
java $JAVA_OPTS -Dunixfs=false -DuseGVFS=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding="UTF-8" -Dsun.jnu.encoding="UTF-8" -Djava.net.useSystemProxies=false -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.deployment=portable -Dnet.filebot.Archive.extractor="$EXTRACTOR" -Dnet.filebot.AcoustID.fpcalc="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" "$@"

View File

@ -12,7 +12,7 @@ while [ -h "$PRG" ] ; do
fi
done
# make it fully qualified
# get canonical path
WORKING_DIR=`pwd`
PRG_DIR=`dirname "$PRG"`
APP_ROOT=`cd "$PRG_DIR" && pwd`
@ -21,33 +21,38 @@ APP_ROOT=`cd "$PRG_DIR" && pwd`
cd "$WORKING_DIR"
# make sure required environment variables are set
if [ -z "$USER" ]
then
if [ -z "$USER" ]; then
export USER=`whoami`
fi
# user per user app data location to avoid permission conflicts between root and admin users
APP_DATA="$APP_ROOT/data/$USER"
# add 3rd party packages to the library path by default
SYNO_FPCALC="/usr/local/chromaprint/bin/fpcalc"
SYNO_LIBRARY_PATH="/usr/local/mediainfo/lib:/usr/local/chromaprint/lib"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SYNO_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$SYNO_LIBRARY_PATH:$APP_ROOT"
fi
# force JVM language and encoding settings
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# 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
# add 3rd party packages to the library path by default
SYNO_FPCALC="/usr/local/chromaprint/bin/fpcalc"
SYNO_LIBRARY_PATH="/usr/local/mediainfo/lib:/usr/local/chromaprint/lib"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SYNO_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$SYNO_LIBRARY_PATH:$APP_ROOT"
fi
# choose extractor
EXTRACTOR="ApacheVFS" # use Apache Commons VFS2 with junrar plugin
# EXTRACTOR="SevenZipExecutable" # use the 7z executable
# EXTRACTOR="SevenZipNativeBindings" # use the lib7-Zip-JBinding.so native library
# create application data folder
APP_DATA="$APP_ROOT/data/$USER"
mkdir -p "$APP_DATA"
if [ ! -w "$APP_DATA" ]; then
echo "$APP_DATA must be set and writable"
exit 1
fi
# start filebot
java $JAVA_OPTS -Djava.awt.headless=true -Dunixfs=false -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dfile.encoding="UTF-8" -Dsun.jnu.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" "$@"

View File

@ -1,26 +1,23 @@
#!/bin/sh
APP_ROOT="/opt/filebot"
# sanity checks
if [ -z "$HOME" ]; then
echo "The environment variable 'HOME' must be set"
echo '$HOME must be set'
exit 1
fi
# prepare filebot java call
APP_ROOT="/opt/filebot"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]; then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
APP_DATA="$HOME/.config/FileBot"
APP_CACHE="$HOME/.cache/FileBot"
# use embedded JRE
JAVA_CMD="$APP_ROOT/jre/bin/java"
# add APP_ROOT to LD_LIBRARY_PATH
if [ ! -z "$LD_LIBRARY_PATH" ]
then
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APP_ROOT"
else
export LD_LIBRARY_PATH="$APP_ROOT"
fi
# start filebot
"$JAVA_CMD" $JAVA_OPTS -Dunixfs=false -DuseGVFS=true -DuseExtendedFileAttributes=true -DuseCreationDate=false -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dsun.java2d.xrender=true -Djava.net.useSystemProxies=true -Dsun.net.client.defaultConnectTimeout=10000 -Dsun.net.client.defaultReadTimeout=60000 -Djna.nosys=true -Dapplication.update=skip -Dapplication.deployment=usc -Dnet.filebot.UserFiles.fileChooser=JavaFX "-Dapplication.dir=$APP_DATA" "-Dapplication.cache=$APP_CACHE/ehcache.disk.store" "-Djava.io.tmpdir=$APP_CACHE/java.io.tmpdir" "-Dnet.filebot.AcoustID.fpcalc=$APP_ROOT/fpcalc" -jar "$APP_ROOT/FileBot.jar" "$@"