File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / ipguard / doc / ipguard.sh.sample
Revision 1.1.1.1.2.1: download - view: text, annotated - select for diffs - revision graph
Tue Oct 18 13:59:21 2016 UTC (7 years, 8 months ago) by misho
Branches: v1_04p0
CVS tags: v1_04p1
Diff to: branchpoint 1.1.1.1: preferred, colored
v1_04p1

#! /bin/sh
##  $Id: ipguard.sh.sample,v 1.1.1.1.2.1 2016/10/18 13:59:21 misho Exp $

PATH=/bin:/usr/bin

iface=fxp0
daemon=ipguard
daemon_path=/usr/local/sbin
daemon_pid=/var/run/${daemon}_${iface}.pid
daemon_flags="-u 300 -xz"

case $1 in
    start)
        if [ -x ${daemon_path}/$daemon ]; then
            ${daemon_path}/$daemon $daemon_flags $iface
            echo -n " $daemon"
        fi
        ;;
    stop)
        if [ -f $daemon_pid ]; then
            kill `head -1 $daemon_pid`
            echo -n " $daemon"
        fi
        ;;
    restart)
        $0 stop
        sleep 1
        $0 start
        ;;
    *)
        echo "Usage: `basename $0` {start|stop|restart}" >&2
        exit 64
        ;;
esac

exit 0

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>