Last active
October 11, 2017 20:25
-
-
Save olegpolukhin/cce385321d117aa1ecedf95643a1c7c1 to your computer and use it in GitHub Desktop.
run http services
This file contains 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
#!/usr/bin/gksu sh | |
prinDotsting () | |
{ | |
DOTSTRING=".................................................." | |
echo "OK $DOTSTRING$DOTSTRING service $1" | |
} | |
printStartServer () | |
{ | |
DOTSTRING=".................................................." | |
text='Service Run' | |
echo "$text$DOTSTRING $1" | |
} | |
date=$(date) | |
echo '/=================================\' | |
echo "RUN SERVER - $date" | |
echo "\n" | |
systemctl stop nginx | |
systemctl stop php7.0-fpm | |
systemctl stop postgresql | |
systemctl start nginx | |
printStartServer 'nginx' | |
systemctl start php7.0-fpm | |
printStartServer 'php7.0-fpm' | |
systemctl start postgresql | |
printStartServer 'postgresql' | |
echo "\n" | |
echo "Status services..." | |
#sleep 1 | |
S1="active" | |
st1=$(systemctl is-active nginx) | |
if [ $st1 = $S1 ] | |
then | |
prinDotsting "NGINX" | |
else | |
echo 'nginx filed' | |
systemctl status nginx | |
echo '********************************************' | |
fi | |
st2=$(systemctl is-active php7.0-fpm) | |
if [ $st2 = $S1 ] | |
then | |
prinDotsting "php7.0-fpm" | |
else | |
echo 'php7.0-fpm filed' | |
systemctl status php7.0-fpm | |
echo '********************************************' | |
fi | |
st3=$(systemctl is-active postgresql) | |
if [ $st3 = $S1 ] | |
then | |
prinDotsting "postgresql" | |
else | |
echo 'postgresql filed' | |
systemctl status postgresql | |
echo '********************************************' | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment