Created
May 30, 2018 16:49
-
-
Save mesaque/c27d962b02593177c93aa4ecab1ee8db to your computer and use it in GitHub Desktop.
initializer.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#services names | |
NGINX_SERVICE='nginx' | |
PHP5_SERVICE='php5-fpm' | |
PHP7_SERVICE='php-fpm7.0' | |
MYSQL_SERVICE='mysql' | |
#test if they are ready | |
NGINX_BIN=$(command -v $NGINX_SERVICE) | |
PHP5_BIN=$(command -v $PHP5_SERVICE) | |
PHP7_BIN=$(command -v $PHP7_SERVICE) | |
MYSQL_BIN=$(command -v $MYSQL_SERVICE) | |
[ $NGINX_BIN ] && $NGINX_BIN -g "daemon off;" & | |
[ $PHP5_BIN ] && $PHP5_BIN --nodaemonize & | |
[ $PHP7_BIN ] && $PHP7_BIN --nodaemonize & | |
[ $MYSQL_BIN ] && /etc/init.d/$MYSQL_SERVICE start & | |
while true; do sleep 1d; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment