1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-30 10:38:37 +00:00
freebsd-ports/security/swatch/files/swatch.in
Michael Scheidell 1793f6d69a - patch swatch.rc to check for buffer overflow in cmdarg with long _flags lines
- add p5-File-Tail dependency
- Bump PORTREVISION

PR:		ports/164529
Submitted by:	scheidell
Approved by:	joseph@randomnetworks.com (maintainer timeout, 15 days), gabor (mentor)
2012-02-10 14:37:30 +00:00

46 lines
956 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: swatch
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# To enable multiple instance of swatch, add lines like below to
# /etc/rc.conf.
#
# swatch_enable="YES"
# swatch_rules="1 2 3"
# swatch_1_flags="--config-file=/rc --tail-file=/log --daemon --pid-file=/pid"
# swatch_1_user="nobody"
# swatch_1_chdir="/var/tmp"
# swatch_1_pidfile="/pid"
# swatch_2_flags="blah, blah"
# swatch_3_flags="blah, blah"
. /etc/rc.subr
name=swatch
rcvar=swatch_enable
load_rc_config ${name}
# set some defaults
: ${swatch_enable:="NO"}
command=%%PREFIX%%/bin/swatch
if [ -n "${swatch_rules}" ]; then
for i in ${swatch_rules}; do
eval swatch_flags=\$swatch_${i}_flags
len=`echo "0${command} ${swatch_flags} (perl)0" | wc -c`
if [ $len -ge 255 ];then
procname=%%LOCALBASE%%/bin/perl
fi
eval swatch_user=\$swatch_${i}_user
eval swatch_chdir=\$swatch_${i}_chdir
eval pidfile=\$swatch_${i}_pidfile
run_rc_command "$1"
done
fi