Created
November 5, 2019 11:39
-
-
Save caionorder/69e7f46a5fa2e8c669b237d7484ed873 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
if [ $1 ] | |
then | |
if [ $1 == start ] | |
then | |
echo start servers. | |
if [ $2 == all ] | |
then | |
brew services start mysql@5.7 | |
sudo apachectl start | |
fi | |
if [ $2 == mysql ] | |
then | |
brew services start mysql@5.7 | |
fi | |
if [ $2 == apache ] | |
then | |
sudo apachectl start | |
fi | |
fi | |
if [ $1 == stop ] | |
then | |
if [ $2 == all ] | |
then | |
brew services stop mysql@5.7 | |
sudo apachectl stop | |
fi | |
if [ $2 == mysql ] | |
then | |
brew services stop mysql@5.7 | |
fi | |
if [ $2 == apache ] | |
then | |
sudo apachectl stop | |
fi | |
fi | |
if [ $1 == restart ] | |
then | |
if [ $2 == all ] | |
then | |
brew services restart mysql@5.7 | |
sudo apachectl restart | |
fi | |
if [ $2 == mysql ] | |
then | |
brew services restart mysql@5.7 | |
fi | |
if [ $2 == apache ] | |
then | |
sudo apachectl restart | |
fi | |
fi | |
else | |
echo Hey man! uses start, stop and restart or service and status. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment