Create a symlink to config file for compatibility with the healthcheck script
parent
3dabbe35a4
commit
03eeee8dd7
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
PORT=${FB_PORT:-$(cat /config/settings.json | sh /JSON.sh | grep '\["port"\]' | awk '{print $2}')}
|
PORT=${FB_PORT:-$(cat /tmp/FB_CONFIG | sh /JSON.sh | grep '\["port"\]' | awk '{print $2}')}
|
||||||
ADDRESS=${FB_ADDRESS:-$(cat /config/settings.json | sh /JSON.sh | grep '\["address"\]' | awk '{print $2}' | sed 's/"//g')}
|
ADDRESS=${FB_ADDRESS:-$(cat /tmp/FB_CONFIG | sh /JSON.sh | grep '\["address"\]' | awk '{print $2}' | sed 's/"//g')}
|
||||||
ADDRESS=${ADDRESS:-localhost}
|
ADDRESS=${ADDRESS:-localhost}
|
||||||
|
|
||||||
wget -q --spider http://$ADDRESS:$PORT/health || exit 1
|
wget -q --spider http://$ADDRESS:$PORT/health || exit 1
|
|
@ -7,19 +7,32 @@ if [ ! -f "/config/settings.json" ]; then
|
||||||
cp -a /defaults/settings.json /config/settings.json
|
cp -a /defaults/settings.json /config/settings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Deal with the case where user does not provide a config argument
|
# Extract config file path from arguments
|
||||||
has_config_arg=0
|
config_file=""
|
||||||
|
next_is_config=0
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
if [ "$next_is_config" -eq 1 ]; then
|
||||||
--config|--config=*|-c|-c=*)
|
config_file="$arg"
|
||||||
has_config_arg=1
|
|
||||||
break
|
break
|
||||||
;;
|
fi
|
||||||
|
case "$arg" in
|
||||||
|
-c|--config)
|
||||||
|
next_is_config=1
|
||||||
|
;;
|
||||||
|
-c=*|--config=*)
|
||||||
|
config_file="${arg#*=}"
|
||||||
|
break
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$has_config_arg" -eq 0 ]; then
|
# If no config argument is provided, set the default and add it to the args
|
||||||
set -- --config=/config/settings.json "$@"
|
if [ -z "$config_file" ]; then
|
||||||
fi
|
config_file="/config/settings.json"
|
||||||
|
set -- --config=/config/settings.json "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create a symlink to the config file for compatibility with the healthcheck script
|
||||||
|
ln -s "$config_file" /tmp/FB_CONFIG
|
||||||
|
|
||||||
exec filebrowser "$@"
|
exec filebrowser "$@"
|
Loading…
Reference in New Issue