Skip to content

Instantly share code, notes, and snippets.

@leonardreidy
Last active December 5, 2016 13:13
Show Gist options
  • Save leonardreidy/7771c11856e1b2038df6393b3a4b7056 to your computer and use it in GitHub Desktop.
Save leonardreidy/7771c11856e1b2038df6393b3a4b7056 to your computer and use it in GitHub Desktop.
Bash function for starting and stopping xampp from the command line on Ubuntu
# Bash function for starting and stopping xampp from the command line on Ubuntu
function xampp() {
# If the argument supplied to the function is --stop
if [[ $@ == "--stop" ]];
then
# stop the xampp/lampp services
sudo bash /opt/lampp/lampp stop
# If the argument supplied to the function is --start
elif [[ $@ == "--start" ]];
then
# start the xampp/lampp services
sudo bash /opt/lampp/lampp start
else
echo "usage: xampp [--start] [--stop]"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment