corz.org text viewer..
[currently viewing: /public/linux/usr/local/bin/ra.sh - raw]
#!/bin/bash
#
# corz.org 2000->
#
# this is a handy script to put in your PATH, usually /usr/local/bin
# this is the first of the series* of apache control scripts
# not exactly rocket science, but anything that saves precious
# keystrokes is okay in my book.
#
#   * which goes some way to explain why the others begin with "r"
#     and not "a"
#
#    ;o)
#    (or
#
# RESTART APACHE!
#
# 2009 - added *Ubuntu apache2


echo
echo `date "+%m.%d.%y-%H.%M"`": restarting apache.."
echo

# 1st, let's try the default apache2 location

if [ -e /usr/local/apache2/bin/apachectl ];then
    echo " "
    sudo /usr/local/apache2/bin/apachectl graceful
exit 0
fi

# then we check the "complete apache2"..

if [ -e /Library/Apache2/bin/apachectl ];then
    echo " "
    sudo /Library/Apache2/bin/apachectl graceful
exit 0
fi

# now we'll look for the OS X Server "opt" location..
# this goes after other regular/mac installs because you may have it and not realise it!

if [ -e /opt/Apache2/bin/apachectl ];then
    echo " "
    sudo /opt/Apache2/bin/apachectl graceful
    exit 0
fi

# lampp maybe..
if [ -e /opt/lampp/bin/apachectl ];then
    echo " "
    sudo /opt/lampp/bin/apachectl graceful
    exit 0
fi

# Linux package (Slackware or similar distro package)
if [ -e /usr/sbin/apachectl ];then
    echo " "
    sudo /usr/sbin/apachectl -k graceful
    exit 0
fi


# Another Linux package (Ubuntu or similar distro package)
if [ -e /usr/sbin/apache2ctl ];then
    echo " "
    sudo /usr/sbin/apache2ctl -k graceful
    exit 0
fi


# if it isn't restarted by now, you must be running Apache 1.3..
echo " "
sudo /usr/local/apache/bin/apachectl graceful

# the other apache control scripts follow the same format

Welcome to corz.org!

Since switching hosts (I hope you are alright, Ed! Wherever you are …) quite a few things seems to be wonky.

Juggling two energetic boys (of very different ages) on Coronavirus lockdown, I'm unlikely to have them all fixed any time soon. Mail me! to prioritise!