From faf0f8e7c3e5d2caf7c1f369e1b0c685ad7bcacc Mon Sep 17 00:00:00 2001 From: Ric Harvey Date: Tue, 9 Aug 2016 14:00:01 +0100 Subject: [PATCH] adding scripting support --- scripts/start.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/start.sh b/scripts/start.sh index f50e95d..b9eebad 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -83,5 +83,17 @@ fi # Always chown webroot for better mounting chown -Rf nginx.nginx /var/www/html +# Run custom scripts +if [[ "$RUN_SCRIPTS" == "1" ]] ; then + if [ -d "/var/www/html/scripts/" ]; then + # make scripts executable incase they aren't + chmod -Rf 750 /var/www/html/scripts/* + # run scripts in number order + for i in `ls /var/www/html/scripts/`; do /var/www/html/scripts/$i ; done + else + echo "Can't find script directory" + fi +fi + # Start supervisord and services /usr/bin/supervisord -n -c /etc/supervisord.conf