Created
April 2, 2024 06:52
-
-
Save sameeramin/76fd2bc738b1a47663b2ed5f1b68ef1a to your computer and use it in GitHub Desktop.
A simple function to start, stop and restart MAMP server from terminal
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
function mamp() { | |
# Author: Muhammad Sameer | |
# Gist: https://gist.github.com/sameeramin/76fd2bc738b1a47663b2ed5f1b68ef1a | |
# License: MIT | |
# Description: A simple function to start, stop and restart MAMP server from terminal | |
if [ -z "$1" ]; then | |
echo "Usage: mamp <start|stop|restart>" | |
return 1 | |
fi | |
if [ "$1" = "start" ]; then | |
/Applications/MAMP/bin/start.sh && osascript -e 'display notification "MAMP started successfully" with title "MAMP"' | |
elif [ "$1" = "stop" ]; then | |
/Applications/MAMP/bin/stop.sh && osascript -e 'display notification "MAMP stopped successfully" with title "MAMP"' | |
elif [ "$1" = "restart" ]; then | |
/Applications/MAMP/bin/stop.sh && /Applications/MAMP/bin/start.sh && osascript -e 'display notification "MAMP restarted successfully" with title "MAMP"' | |
else | |
echo "Usage: mamp <start|stop|restart>" | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment