From 4b6d826339344f5103b62aa7ddcbc8ea8338f237 Mon Sep 17 00:00:00 2001 From: tripathyr Date: Sun, 17 Jul 2022 13:35:00 +0530 Subject: [PATCH] Update run.sh --- run.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/run.sh b/run.sh index 5e8f96e..04744a4 100755 --- a/run.sh +++ b/run.sh @@ -4,6 +4,25 @@ cd /etc/supervisor/conf.d/ sed -i "s|command=hypercorn -w 1 -b 0.0.0.0:6012 wsgi:app|command=hypercorn -w 1 -b $FLOAPIURL wsgi:app|" /etc/supervisor/conf.d/ftt-ranchimallflo.conf sed -i "s|window.tokenapiUrl = 'https://ranchimallflo.duckdns.org'|window.tokenapiUrl = '$FLOAPIURL'|" /floscout/index.html +if [ ! -z "$FLOSCOUT_BOOTSTRAP" ] && [ "$(cat /data/floscout-url.txt)" != "$FLOSCOUT_BOOTSTRAP" ] +then + # download and extract Floscout boostrap + echo 'Downloading FLOSCOUT Bootstrap...' + RUNTIME="$(date +%s)" + curl -L $FLOSCOUT_BOOTSTRAP -o /data/data.zip --progress-bar | tee /dev/null + RUNTIME="$(($(date +%s)-RUNTIME))" + echo "FLOSCOUT BOOTSTRAP Download Complete (took ${RUNTIME} seconds)" + echo 'Extracting Bootstrap...' + RUNTIME="$(date +%s)" + upzip /data/data.zip -d /data + RUNTIME="$(($(date +%s)-RUNTIME))" + echo "FLOSCOUT Bootstrap Extraction Complete! (took ${RUNTIME} seconds)" + rm -f /data/data.zip + echo 'Erased Bootstrap `.zip` file' + echo "$FLOSCOUT_BOOTSTRAP" > /data/floscout-url.txt + ls /data +fi + echo "running..." #supervisord -c /etc/supervisor/conf.d/ftt-ranchimallflo.conf -#./floscout/example \ No newline at end of file +#./floscout/example