Remove BASHisms from start script

This commit is contained in:
Sebastian Riedel
2017-12-18 21:14:41 +01:00
parent aacda9eeb9
commit 35cb711ca1
+5 -6
View File
@@ -1,23 +1,22 @@
#!/bin/sh -e #!/bin/sh -e
#check for all dependencies #check for all dependencies
for prog in {mono,readlink,df,7za};do for prog in mono readlink df 7za;do
[ -n "`whereis -b ${prog} | cut -sd' ' -f2`" ] || (echo "Please install ${prog}" && exit 1); [ -n "`whereis -b ${prog} | cut -sd' ' -f2`" ] || (echo "Please install ${prog}" && exit 1);
done done
for lib in libsqlite3;do for lib in libsqlite3;do
[ -n "`ldconfig -p | grep ${lib}`" ] || (echo "Please install ${lib}" && exit 1); [ -n "`ldconfig -p | grep ${lib}`" ] || (echo "Please install ${lib}" && exit 1);
done done
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"; DIR="$( cd "$( dirname "$(pwd)/$0" )" && pwd )";
echo "Located in ${DIR}"; echo "Located in ${DIR}";
GBMPATH='./'; GBMPATH='./';
#locate GBM.exe #locate GBM.exe
if [ \( "${DIR}" == '/bin' \) -a \( -s '/usr/share/gbm/GBM.exe' \) ]; then if [ "${DIR}" = '/bin' ] && [ -s '/usr/share/gbm/GBM.exe' ]; then
GBMPATH='/usr/share/gbm/'; GBMPATH='/usr/share/gbm/';
elif [ \( "${DIR}" == '/usr/local/bin' \) -a \( -s '/usr/local/share/gbm/GBM.exe' \) ]; then elif [ "${DIR}" = '/usr/local/bin' ] && [ -s '/usr/local/share/gbm/GBM.exe' ]; then
GBMPATH='/usr/local/share/gbm/'; GBMPATH='/usr/local/share/gbm/';
elif [ ! -s './GBM.exe' ]; then elif [ ! -s './GBM.exe' ]; then
echo 'GBM.exe not found'; echo 'GBM.exe not found';
exit 2; exit 2;
fi fi
mono --desktop ${GBMPATH}'GBM.exe' "$@"; mono --desktop ${GBMPATH}'GBM.exe' "$@";
exit 0; exit $?;