Группа :: Система/Серверы
Пакет: portsentry
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
#!/bin/sh
#
# portsentry Start the portsentry Port Scan Detector
#
# author: Aleksandr Blokhin 'Sass' <sass@altlinux.ru>
#
# chkconfig: - 98 02
# description: PortSentry Port Scan Detector is part of the Abacus Project
# suite of tools. The Abacus Project is an initiative to release
# low-maintenance, generic, and reliable host based intrusion
# detection software to the Internet community.
# processname: portsentry
# config /etc/portsentry/portsentry.conf
# Do not load RH compatibility interface.
WITHOUT_RC_COMPAT=1
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network
LOCKFILE=/var/lock/subsys/portsentry
RETVAL=0
MODES="atcp audp"
start()
{
is_yes "$NETWORKING" || return 0
if [ -e "$LOCKFILE" ]; then
msg_already_running portsentry
passed "portsentry startup"
RETVAL=$?
echo
return $RETVAL
fi
for i in $MODES; do
action $"Starting port scan detector: " /usr/sbin/portsentry -$i
RETVAL=$?
[ $RETVAL -eq 0 ] && touch "$LOCKFILE"
done
return $RETVAL
}
stop()
{
stop_daemon --lockfile "$LOCKFILE" --expect-user root portsentry
RETVAL=$?
return $RETVAL
}
restart()
{
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user root portsentry
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac
exit $RETVAL