#!/bin/sh
# ----------------------------
#  switch script
# ----------------------------
# Version : 1.0
# date    : 2008/04/04

export LANG=C
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:$PATH

# Set

BASEDIR="/usr/local/apache"
BINDIR="/etc/init.d"
CONFDIR=$BASEDIR"/conf"

CONF="httpd.conf"
INIT="apachectl"
ONCONF="httpd.conf.on"
OFFCONF="httpd.conf.off"

# Exec
cd $CONFDIR

case "$1" in
on)
        if [ -f $CONFDIR/$ONCONF ]; then
         echo -n "Apache DMZ Address Listen ON: "
         $BINDIR/$INIT stop
         sleep 3
         rm -f $CONFDIR/$CONF ; ln -s $ONCONF $CONF
         echo
         $BINDIR/$INIT start
         echo
        else
         echo "ERR: "$CONFDIR/$ONCONF" not found"
         exit 1
        fi
        ;;
off)
        if [ -f $CONFDIR/$OFFCONF ]; then
         echo -n "Apache DMZ Address Listen  OFF: "
         $BINDIR/$INIT stop
         sleep 3
         rm -f $CONFDIR/$CONF ; ln -s $OFFCONF $CONF
         echo
         $BINDIR/$INIT start
         echo
        else
         echo "ERR: "$CONFDIR/$OFFCONF" not found"
         exit 1
        fi
        ;;
*)
        echo "Usage: $0 {on|off}"
        exit 1
esac
exit 0
# EOF

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2008-05-02 (金) 14:46:23 (5781d)