Last Updated: February 25, 2016
·
418
· nyanev

Manage Apache server and database from one script

This is very simple script. You should supply operation that you want to execute

#!/bin/bash

if [ ! -n "$1" ]
then
  echo "Usage: `basename $0` argument1 (start|stop|restart)"
  exit $E_BADARGS
fi

sudo /Library/StartupItems/MySQLCOM/MySQLCOM $1
sudo apachectl $1