Compare commits

...

1 commit

Author SHA1 Message Date
Innovation f13e5daa32 Begin work on execute.sh's actual job 2024-05-25 05:56:39 +01:00

View file

@ -1,3 +1,32 @@
#!/bin/bash
# Environment variables:
# NIGHTSRV_DEV_BIND_ALL - Makes flask bind to 0.0.0.0. Useful if you want to server to other devices for development reasons. NIGHTSRV_DEV_BIND_ALL=1
# NIGHTSRV_BLACKLIST_MODULES - Blacklist modules from being run. Should be a python file (i.e. vitalsd.py). Example: NIGHTSRV_BLACKLIST_MODULES=vitalsd.py navigationd.py
export FLASK_APP=nightserver.py
flask run
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
MODULES_DIR="$(dirname "$(readlink -f "$0")")/modules"
MODULES=( $MODULES_DIR/* )
if [ "$NIGHTSRV_DEV_BIND_ALL" == "1" ]; then
echo "WARNING - NIGHTSRV_DEV_BIND_ALL is set to bind to 0.0.0.0. This is insecure and should only be used for development reasons."
flask run --host=0.0.0.0 &>logs/nightserver.log
else
echo "Normal flask start"
flask run &>logs/nightserver.log
fi
echo "Sleep for a bit to let flask init"
sleep 2
#echo "Starting modules."
#for MODULE in $MODULES
#do
# echo $MODULE
# MODULEFILE_PARSE=($(echo $MODULE | tr "/" "\n"))
# echo $MODULEFILE_PARSE
# MODULEFILE_LEN=${#MODULEFILE[@]}
# echo $MOFULEFILE_LEN
# MODULEFILE=${MODULEFILE[$MODULEFILE_LEN-1]}
#done