Fix trivial instances of wrong autoconf exitcodes

This commit is contained in:
Lars Kruse 2018-09-16 04:01:57 +02:00
parent 99f6979f22
commit e4cd049b01
152 changed files with 225 additions and 344 deletions

View File

@ -116,17 +116,15 @@ fi
if [ "$1" == "autoconf" ]; then if [ "$1" == "autoconf" ]; then
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
$IPTABLES -L INPUT -v -n -x -w >/dev/null 2>/dev/null $IPTABLES -L INPUT -v -n -x -w >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)" echo "no (could not run iptables as user `whoami`)"
exit 1 else
else echo yes
echo yes
exit 0
fi fi
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -37,11 +37,10 @@ mktempfile () {
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" -a -n "${BC}" -a -x "${BC}" ] ; then if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" -a -n "${BC}" -a -x "${BC}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -45,11 +45,10 @@ my($db_home) = # DB databases directory
if ($ARGV[0] and $ARGV[0] eq "autoconf") { if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if (-x "/usr/sbin/amavisd-agent") { if (-x "/usr/sbin/amavisd-agent") {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no (/usr/sbin/amavisd-agent not found or not executable)\n"; print "no (/usr/sbin/amavisd-agent not found or not executable)\n";
exit 1;
} }
exit 0;
} elsif ($ARGV[0] and $ARGV[0] eq "suggest") { } elsif ($ARGV[0] and $ARGV[0] eq "suggest") {
print "time\n"; print "time\n";
print "cache\n"; print "cache\n";

View File

@ -23,11 +23,10 @@ STATEFILE=$MUNIN_PLUGSTATE/amavis.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -54,14 +54,13 @@ sub autoconf
if (-d $LOGDIR) { if (-d $LOGDIR) {
if (-f $logfile) { if (-f $logfile) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no (logfile not found)\n"; print "no (logfile not found)\n";
} }
} else { } else {
print "no (could not find logdir)\n"; print "no (could not find logdir)\n";
} }
exit 1; exit 0;
} }
sub config sub config

View File

@ -42,7 +42,7 @@ my %chars = (
if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if ($ret) { if ($ret) {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; exit 0;
} }
my $ua = LWP::UserAgent->new(timeout => 30); my $ua = LWP::UserAgent->new(timeout => 30);
my @badports; my @badports;
@ -55,7 +55,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if (@badports) { if (@badports) {
print "no (no apache server-status on ports @badports)\n"; print "no (no apache server-status on ports @badports)\n";
exit 1; exit 0;
} else { } else {
print "yes\n"; print "yes\n";
exit 0; exit 0;

View File

@ -23,16 +23,13 @@ then
if ! ls $ACCESSLOG > /dev/null if ! ls $ACCESSLOG > /dev/null
then then
echo "no (could not find apache access log \"$ACCESSLOG\")" echo "no (could not find apache access log \"$ACCESSLOG\")"
exit 1
elif ! ls $DIRECTORY > /dev/null elif ! ls $DIRECTORY > /dev/null
then then
echo "no (could not find munin plugins directory \"$DIRECTORY\")" echo "no (could not find munin plugins directory \"$DIRECTORY\")"
exit 2
else else
echo "yes" echo "yes"
exit 0
fi fi
exit 0
fi fi
# ######################################################################################### INIT # ######################################################################################### INIT

View File

@ -39,7 +39,7 @@ my $type = "throughput";
if (exists $ARGV[0] and $ARGV[0] eq "autoconf") { if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if ($ret) { if ($ret) {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; exit 0;
} }
my $ua = LWP::UserAgent->new (timeout => 30); my $ua = LWP::UserAgent->new (timeout => 30);
my @badports; my @badports;
@ -52,7 +52,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
if (@badports) { if (@badports) {
print "no (no mod_watch exists on ports @badports)\n"; print "no (no mod_watch exists on ports @badports)\n";
exit 1; exit 0;
} else { } else {
print "yes\n"; print "yes\n";
exit 0; exit 0;

View File

@ -11,15 +11,13 @@ if [ "$1" = "autoconf" ]; then
asterisk -rx 'sip show inuse' > /dev/null asterisk -rx 'sip show inuse' > /dev/null
if [ $? = "0" ]; then if [ $? = "0" ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -32,11 +32,10 @@
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if grep -q 'present.*yes' /proc/acpi/battery/*/info > /dev/null 2>&1; then if grep -q 'present.*yes' /proc/acpi/battery/*/info > /dev/null 2>&1; then
echo yes echo yes
exit 0
else else
echo "no (battery not detected)" echo "no (battery not detected)"
exit 1
fi fi
exit 0
fi fi
cd /proc/acpi/battery cd /proc/acpi/battery

View File

@ -29,7 +29,6 @@ mktempfile () {
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -n "${B3NAME}" -a -f "${logfile}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ]; then if [ -n "${B3NAME}" -a -f "${logfile}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ]; then
echo yes echo yes
exit 0
else else
echo -n "no" echo -n "no"
if [ ! -n "${B3NAME}" ]; then if [ ! -n "${B3NAME}" ]; then
@ -43,8 +42,8 @@ if [ "$1" = "autoconf" ]; then
elif [ ! -x "${LOGTAIL}" ]; then elif [ ! -x "${LOGTAIL}" ]; then
echo " (cannot execute ${LOGTAIL})" echo " (cannot execute ${LOGTAIL})"
fi fi
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -98,11 +98,11 @@ if ( defined($ARGV[0]) && $ARGV[0] eq "config" ) {
if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) { if ( defined($ARGV[0]) && $ARGV[0] eq "autoconf" ) {
if (! -f $stat_file) { if (! -f $stat_file) {
printf "Unable to file bind stat file on %s",$stat_file; printf "Unable to file bind stat file on %s",$stat_file;
exit 1; exit 0;
} }
if (! -f $rndc) { if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc; printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1; exit 0;
} }
exit 0; exit 0;
} }

View File

@ -111,11 +111,10 @@ sub get_stats {
sub autoconf { sub autoconf {
if (-S $socket) { if (-S $socket) {
say 'yes'; say 'yes';
exit 0;
} else { } else {
say 'no'; say 'no';
exit 1;
} }
exit 0;
} }
sub config { sub config {

View File

@ -63,7 +63,7 @@ sub autoconf {
} }
} }
print "no\n"; print "no\n";
exit 1; exit 0;
} }
sub config { sub config {

View File

@ -52,7 +52,7 @@ fi
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo "no" echo "no"
exit 1 exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -53,7 +53,7 @@ fi
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo "no" echo "no"
exit 1 exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -55,7 +55,7 @@ fi
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo "no" echo "no"
exit 1 exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -52,7 +52,7 @@ fi
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
echo "no" echo "no"
exit 1 exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -58,11 +58,10 @@ ID=1;
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -d $DIR ]; then if [ -d $DIR ]; then
echo "yes" echo "yes"
exit 0
else else
echo "no (check your path)" echo "no (check your path)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -57,11 +57,10 @@ lse2() {
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if which dumpe2fs >/dev/null 2>&1; then if which dumpe2fs >/dev/null 2>&1; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then
lse2 | while read name rest; do lse2 | while read name rest; do

View File

@ -60,7 +60,6 @@ if (defined($ARGV[0])) {
my @chk_result = `$hpasmcli -s \"help\"`; my @chk_result = `$hpasmcli -s \"help\"`;
if ($? eq "0") { if ($? eq "0") {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
my $reason = 'Unknown error'; my $reason = 'Unknown error';
foreach my $line (@chk_result) { foreach my $line (@chk_result) {
@ -71,12 +70,11 @@ if (defined($ARGV[0])) {
} }
} }
print "no ($reason)\n"; print "no ($reason)\n";
exit 1;
} }
} else { } else {
print "no (hpasmcli not found)\n"; print "no (hpasmcli not found)\n";
exit 1;
} }
exit 0;
} elsif ($ARGV[0] eq 'suggest') { } elsif ($ARGV[0] eq 'suggest') {
print "temp\nfans\n"; print "temp\nfans\n";
exit 0; exit 0;

View File

@ -147,12 +147,11 @@ if ( defined $ARGV[0] && $ARGV[0] eq 'autoconf' ) {
if ( !$@ && keys %stats ) { if ( !$@ && keys %stats ) {
print "yes\n"; print "yes\n";
exit 0;
} }
else { else {
print "no\n"; print "no\n";
exit 1;
} }
exit 0;
} }

View File

@ -96,10 +96,10 @@ $mdstat_present = -f '/proc/mdstat';
if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf") { if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf") {
if ($mdstat_present and ($detailed_present or $stat_present)) { if ($mdstat_present and ($detailed_present or $stat_present)) {
print "yes\n"; print "yes\n";
exit 0; } else {
print "no\n";
} }
print "no\n"; exit 0;
exit 1;
} }
my %devs; my %devs;

View File

@ -126,11 +126,10 @@ my %config = (
if ($ARGV[0] and $ARGV[0] eq "autoconf" ) { if ($ARGV[0] and $ARGV[0] eq "autoconf" ) {
if (-e $Command ) { if (-e $Command ) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no\n"; print "no\n";
exit 1
} }
exit 0;
} }
#Read Output of MegaRaid command #Read Output of MegaRaid command

View File

@ -30,14 +30,12 @@ returnval=$?
if [ "x$1" = "xautoconf" ]; then if [ "x$1" = "xautoconf" ]; then
if [ -z "$targets" ]; then if [ -z "$targets" ]; then
echo "no (no md devices found under /sys/devices/virtual/block/*/md/mismatch_cnt)" echo "no (no md devices found under /sys/devices/virtual/block/*/md/mismatch_cnt)"
exit 1;
elif [ "x$returnval" != "x0" ]; then elif [ "x$returnval" != "x0" ]; then
echo "no (discovery of md devices failed strangely)" echo "no (discovery of md devices failed strangely)"
exit 1;
else else
echo "yes" echo "yes"
exit 0
fi fi
exit 0
fi fi
if [ "x$1" = "xconfig" ]; then if [ "x$1" = "xconfig" ]; then

View File

@ -37,11 +37,10 @@ STATEFILE=$MUNIN_PLUGSTATE/dkimproxy_mails.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -36,12 +36,12 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if (! -x $DOVEADM) { if (! -x $DOVEADM) {
print "no (no doveadm)\n"; print "no (no doveadm)\n";
exit(1); exit(0);
} }
if (! -f $logfile) { if (! -f $logfile) {
print "no (logfile $logfile does not exist)\n"; print "no (logfile $logfile does not exist)\n";
exit(1); exit(0);
} }
if (-r "$logfile") { if (-r "$logfile") {
@ -50,7 +50,7 @@ if ( $ARGV[0] and $ARGV[0] eq "autoconf" ) {
} else { } else {
print "no (logfile not readable)\n"; print "no (logfile not readable)\n";
} }
exit 1; exit 0;
} }
if (-f "$logfile.0") { if (-f "$logfile.0") {

View File

@ -19,11 +19,10 @@
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r /proc/acpi/ibm/fan ]; then if [ -r /proc/acpi/ibm/fan ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi

View File

@ -20,11 +20,10 @@ FAXQ=${faxq:=/usr/sbin/faxqclean}
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -x ${FAXSTAT} ] ; then if [ -x ${FAXSTAT} ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
JOBTYPES="Running Waiting Done" JOBTYPES="Running Waiting Done"

View File

@ -42,11 +42,11 @@ if [ "$1" = "autoconf" ]; then
exit 0 exit 0
else else
echo "no (logtail not found)" echo "no (logtail not found)"
exit 1 exit 0
fi fi
else else
echo "no (logfile $LOGFILE does not exist)" echo "no (logfile $LOGFILE does not exist)"
exit 1 exit 0
fi fi
fi fi

View File

@ -32,11 +32,11 @@ if [ "$1" = "autoconf" ]; then
exit 0 exit 0
else else
echo "no (logtail not found)" echo "no (logtail not found)"
exit 1 exit 0
fi fi
else else
echo "no (logfile ${LOGFILE} does not exist)" echo "no (logfile ${LOGFILE} does not exist)"
exit 1 exit 0
fi fi
fi fi

View File

@ -8,7 +8,7 @@ if [ "$1" = "autoconf" ]; then
exit 0 exit 0
else else
echo no echo no
exit 1 exit 0
fi fi
fi fi

View File

@ -56,7 +56,7 @@ then
exit 0 exit 0
else else
echo no echo no
exit 1 exit 0
fi fi
fi fi

View File

@ -83,7 +83,7 @@ when "autoconf"
exit 0 exit 0
end end
puts "no" puts "no"
exit 1 exit 0
else else
mpm.run mpm.run
end end

View File

@ -94,7 +94,7 @@ when "autoconf"
exit 0 exit 0
end end
puts "no" puts "no"
exit 1 exit 0
else else
mpm.run mpm.run
end end

View File

@ -26,11 +26,11 @@ case $1 in
autoconf|detect) autoconf|detect)
if [ -d $ICEDIR/ ] ; then if [ -d $ICEDIR/ ] ; then
echo yes echo yes
exit 0
else else
echo "no (icedir not found)" echo "no (icedir not found)"
exit 1 fi
fi;; exit 0
;;
config) config)
cat <<'EOF' cat <<'EOF'
graph_title Icecast2 Stream Listeners graph_title Icecast2 Stream Listeners

View File

@ -31,15 +31,13 @@ if [ "$1" = "autoconf" ]; then
ip6tables -L INPUT -v -n -x -w >/dev/null 2>/dev/null ip6tables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "no (could not run ip6tables as user `whoami`)" echo "no (could not run ip6tables as user `whoami`)"
exit 1
else else
echo yes echo yes
exit 0
fi fi
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -14,11 +14,10 @@ pid=`pgrep -o -x "$process"`
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r /proc/$pid/status ]; then if [ -r /proc/$pid/status ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -61,7 +61,7 @@ sub autoconf {
if ($ret) if ($ret)
{ {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; exit 0;
} }
my $conn = IO::Socket::INET->new(PeerAddr => $host, my $conn = IO::Socket::INET->new(PeerAddr => $host,
@ -72,7 +72,7 @@ sub autoconf {
if (!$conn) if (!$conn)
{ {
print "no (could not connect: $!)\n"; print "no (could not connect: $!)\n";
exit 1; exit 0;
} }
my $request = "!stats\n"; my $request = "!stats\n";

View File

@ -61,7 +61,7 @@ sub autoconf {
if ($ret) if ($ret)
{ {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; exit 0;
} }
my $conn = IO::Socket::INET->new(PeerAddr => $host, my $conn = IO::Socket::INET->new(PeerAddr => $host,
@ -72,7 +72,7 @@ sub autoconf {
if (!$conn) if (!$conn)
{ {
print "no (could not connect: $!)\n"; print "no (could not connect: $!)\n";
exit 1; exit 0;
} }
my $request = "!stats\n"; my $request = "!stats\n";

View File

@ -78,9 +78,9 @@ MINUTE_BY_GREP_RANGE=10
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ $CHECKMAX -le 1 ]; then if [ $CHECKMAX -le 1 ]; then
echo no echo no
exit 1 else
echo yes
fi fi
echo yes
exit 0 exit 0
fi fi

View File

@ -40,9 +40,9 @@ let CHECKMAX="$CHECKMAX + 1"
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ $CHECKMAX -le 1 ]; then if [ $CHECKMAX -le 1 ]; then
echo no echo no
exit 1 else
echo yes
fi fi
echo yes
exit 0 exit 0
fi fi

View File

@ -90,9 +90,9 @@ CURL=/usr/bin/curl
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ $CHECKMAX -le 1 ]; then if [ $CHECKMAX -le 1 ]; then
echo no echo no
exit 1 else
echo yes
fi fi
echo yes
exit 0 exit 0
fi fi

View File

@ -40,11 +40,11 @@ fi
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f $UPDATE_STATSFILE ]; then if [ -f $UPDATE_STATSFILE ]; then
echo "yes" echo "yes"
exit 0 else
echo "no (logfile not readable)"
fi fi
echo "no (logfile not readable)" exit 0
exit 1
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -42,11 +42,10 @@ then
if du -sb $DIR &> /dev/null if du -sb $DIR &> /dev/null
then then
echo "yes" echo "yes"
exit 0
else else
echo "no" echo "no"
exit 1
fi fi
exit 0
elif [ "${1:-}" = "config" ] elif [ "${1:-}" = "config" ]
then then
echo "graph_title MySQL on-disk database size" echo "graph_title MySQL on-disk database size"

View File

@ -46,11 +46,10 @@ if ($ARGV[0]) {
if ($ARGV[0] eq 'autoconf') { if ($ARGV[0] eq 'autoconf') {
if (-r $NAGIOSSTAT) { if (-r $NAGIOSSTAT) {
print "yes"; print "yes";
exit 0;
} else { } else {
print "no (Nagios status file not found)"; print "no (Nagios status file not found)";
exit 1;
} }
exit 0;
} elsif ($ARGV[0] eq "config") { } elsif ($ARGV[0] eq "config") {
print "graph_args --base 1000 -l 0 --vertical-label Checks\n"; print "graph_args --base 1000 -l 0 --vertical-label Checks\n";
print "graph_title Nagios status\n"; print "graph_title Nagios status\n";

View File

@ -19,11 +19,10 @@ LOG=/etc/hosts.deny
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r "$LOG" ]; then if [ -r "$LOG" ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -93,11 +93,10 @@ if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if (! -s $resconf) { $ret .= "$resconf not found. "; } if (! -s $resconf) { $ret .= "$resconf not found. "; }
if ($ret) { if ($ret) {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1;
} else { } else {
print "yes\n"; print "yes\n";
exit 0;
} }
exit 0;
} }
if ( defined $ARGV[0] and $ARGV[0] eq "suggest" ) { if ( defined $ARGV[0] and $ARGV[0] eq "suggest" ) {

View File

@ -42,11 +42,10 @@ if [ "$1" = "autoconf" ]; then
$ETHTOOL 2>/dev/null >/dev/null $ETHTOOL 2>/dev/null >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo no echo no
exit 1
else else
echo yes echo yes
exit 0
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -272,11 +272,10 @@ if ( !( ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) or
if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf" ) { if ( defined($ARGV[0]) and $ARGV[0] eq "autoconf" ) {
if ( ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) or ( $usenetstat eq "no" and defined($adminhost) and defined($adminport) and defined($adminusername) and defined($adminpassword) ) ) { if ( ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) or ( $usenetstat eq "no" and defined($adminhost) and defined($adminport) and defined($adminusername) and defined($adminpassword) ) ) {
print("yes\n"); print("yes\n");
exit 0;
} else { } else {
print("no\n"); print("no\n");
exit 1;
} }
exit 0;
} }
if ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) { if ( $usenetstat eq "yes" and defined($fmshost) and defined($fmsport) ) {

View File

@ -200,11 +200,10 @@ if ( defined($ARGV[0]) ) {
if ( $ARGV[0] eq "autoconf" ) { if ( $ARGV[0] eq "autoconf" ) {
if ( defined($host) and defined($port) and defined($username) and defined($password) ) { if ( defined($host) and defined($port) and defined($username) and defined($password) ) {
print("yes\n"); print("yes\n");
exit 0;
} else { } else {
print("no\n"); print("no\n");
exit 1;
} }
exit 0;
} elsif ( $ARGV[0] eq "config" ) { } elsif ( $ARGV[0] eq "config" ) {
print <<'END_GRAPH_CONFIG'; print <<'END_GRAPH_CONFIG';
graph_title Flash Media Server application connections graph_title Flash Media Server application connections

View File

@ -201,11 +201,10 @@ if ( defined($ARGV[0]) ) {
if ( $ARGV[0] eq "autoconf" ) { if ( $ARGV[0] eq "autoconf" ) {
if ( defined($host) and defined($port) and defined($username) and defined($password) ) { if ( defined($host) and defined($port) and defined($username) and defined($password) ) {
print("yes\n"); print("yes\n");
exit 0;
} else { } else {
print("no\n"); print("no\n");
exit 1;
} }
exit 0;
} elsif ( $ARGV[0] eq "config" ) { } elsif ( $ARGV[0] eq "config" ) {
print <<'END_GRAPH_CONFIG'; print <<'END_GRAPH_CONFIG';
graph_title Flash Media Server application connection rates graph_title Flash Media Server application connection rates

View File

@ -64,15 +64,13 @@ if [ "$1" = "autoconf" ]; then
iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)" echo "no (could not run iptables as user `whoami`)"
exit 1
else else
echo yes echo yes
exit 0
fi fi
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -24,11 +24,10 @@
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r "$LOG" ]; then if [ -r "$LOG" ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -122,10 +122,8 @@ EOF
autoconf) autoconf)
if [[ $(ifconfig &> /dev/null; echo "$?") == 0 ]]; then if [[ $(ifconfig &> /dev/null; echo "$?") == 0 ]]; then
echo yes echo yes
exit 0
else else
echo "no (ifconfig doesn't work out)" echo "no (ifconfig doesn't work out)"
exit 1
fi fi
exit 0 exit 0
;; ;;

View File

@ -30,15 +30,13 @@ if [ "$1" = "autoconf" ]; then
iptables-save -c >/dev/null 2>/dev/null iptables-save -c >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "no (could not run iptables-save as user `whoami`)" echo "no (could not run iptables-save as user `whoami`)"
exit 1
else else
echo yes echo yes
exit 0
fi fi
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -34,13 +34,13 @@ ipfw="/sbin/ipfw"
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ ! -x $ipfw ]; then if [ ! -x $ipfw ]; then
echo "no ($ipfw not found)" echo "no ($ipfw not found)"
exit 1 exit 0
fi fi
err=$($ipfw nat show config 2>&1) err=$($ipfw nat show config 2>&1)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "no ($err)" echo "no ($err)"
exit 1 exit 0
fi fi
echo "yes" echo "yes"

View File

@ -45,15 +45,13 @@ if [ "$1" = "autoconf" ]; then
iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null iptables -L INPUT -v -n -x -w >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)" echo "no (could not run iptables as user `whoami`)"
exit 1
else else
echo yes echo yes
exit 0
fi fi
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -48,15 +48,13 @@ if [ "$1" = "autoconf" ]; then
RES=`$iptables -L $TNAME -nvx -w 2>&1 >/dev/null` RES=`$iptables -L $TNAME -nvx -w 2>&1 >/dev/null`
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`; $RES)" echo "no (could not run iptables as user `whoami`; $RES)"
exit 1
else else
echo yes echo yes
exit 0
fi fi
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "suggest" ]; then if [ "$1" = "suggest" ]; then

View File

@ -99,12 +99,11 @@ if [ "$1" = "autoconf" ]; then
done done
if [ -n "$ONE_LISTENING" ]; then if [ -n "$ONE_LISTENING" ]; then
echo yes echo "yes"
exit 0
else else
echo no '(no slapd listening on '$PORTS')' echo "no (no slapd listening on $PORTS)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -34,17 +34,15 @@ totrace=`basename $0 | sed 's/^mtr100_//g'`
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if ( mtr -nrc 1 localhost 2>/dev/null >/dev/null ); then if ( mtr -nrc 1 localhost 2>/dev/null >/dev/null ); then
echo yes echo yes
exit 0
else else
if [ $? -eq 127 ] if [ $? -eq 127 ]
then then
echo "no (mtr program not found - install the mtr(-tiny) package)" echo "no (mtr program not found - install the mtr(-tiny) package)"
exit 1
else else
echo no echo no
exit 1
fi fi
fi fi
exit 0
exit 0 exit 0
fi fi

View File

@ -32,11 +32,10 @@ STRIP_OUTPUT="/\($TO_REMOVE\)/d"
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r $NETSTATS ]; then if [ -r $NETSTATS ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -46,9 +46,9 @@ if ( exists $ARGV[0] and $ARGV[0] eq 'autoconf' ) {
} else { } else {
print "no (program $TC died)\n"; print "no (program $TC died)\n";
} }
exit 1; } else {
print "yes\n";
} }
print "yes\n";
exit 0; exit 0;
} }

View File

@ -43,11 +43,10 @@ elif [ "$1" == "autoconf" ]; then
if [ -x /usr/bin/time ] && [ -x /usr/bin/nc ]; then if [ -x /usr/bin/time ] && [ -x /usr/bin/nc ]; then
echo "yes" echo "yes"
exit 0
else else
echo "no (/usr/bin/time or /usr/bin/nc missing)" echo "no (/usr/bin/time or /usr/bin/nc missing)"
exit 1
fi fi
exit 0
else else

View File

@ -52,11 +52,10 @@ case "$1" in
autoconf) autoconf)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
echo yes echo yes
exit 0
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
;; ;;
suggest) suggest)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then

View File

@ -23,11 +23,10 @@ case $1 in
autoconf) autoconf)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
echo yes echo yes
exit 0
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
;; ;;
suggest) suggest)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then

View File

@ -23,11 +23,10 @@ case $1 in
autoconf) autoconf)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
echo yes echo yes
exit 0
else else
echo "no (/proc/net/dev not found)" echo "no (/proc/net/dev not found)"
exit 1
fi fi
exit 0
;; ;;
suggest) suggest)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then

View File

@ -233,9 +233,9 @@ sub load_data {
if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) { if ( defined $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if ($ret) { if ($ret) {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; } else {
print "yes\n";
} }
print "yes\n";
exit 0; exit 0;
} }

View File

@ -48,11 +48,10 @@ proc="access close commit create delegpurge delegreturn getattr getfh link lock
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "$NFSD" ]; then if [ -f "$NFSD" ]; then
echo yes echo yes
exit 0
else else
echo "no (no $NFSD)" echo "no (no $NFSD)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -48,7 +48,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
{ {
if ($ret){ if ($ret){
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; exit 0;
} }
my $ua = LWP::UserAgent->new(timeout => 30); my $ua = LWP::UserAgent->new(timeout => 30);
@ -57,7 +57,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
unless ($response->is_success and $response->content =~ /server/im) unless ($response->is_success and $response->content =~ /server/im)
{ {
print "no (no nginx status on $URL)\n"; print "no (no nginx status on $URL)\n";
exit 1; exit 0;
} }
else else
{ {

View File

@ -112,7 +112,7 @@ my $UA = exists $ENV{'ua'} ? $ENV{'ua'} : 'nginx-status-verifier/0.1';
if (exists $ARGV[0] and $ARGV[0] eq "autoconf" ) { if (exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
if ($ret) { if ($ret) {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1; exit 0;
} }
my $ua = LWP::UserAgent->new(timeout => 30); my $ua = LWP::UserAgent->new(timeout => 30);
# Set the UA to something different from the libwww-perl. # Set the UA to something different from the libwww-perl.
@ -122,7 +122,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf" ) {
unless ($response->is_success and $response->content =~ /server/im) { unless ($response->is_success and $response->content =~ /server/im) {
print "no (no nginx status on $URL)\n"; print "no (no nginx status on $URL)\n";
exit 1; exit 0;
} else { } else {
print "yes\n"; print "yes\n";
exit 0; exit 0;

View File

@ -69,15 +69,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if ($? eq "0") { if ($? eq "0") {
if (`$NTPQ -np | wc -l` > 0) { if (`$NTPQ -np | wc -l` > 0) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no (unable to list peers)\n"; print "no (unable to list peers)\n";
exit 1;
} }
} else { } else {
print "no (ntpq not found)\n"; print "no (ntpq not found)\n";
exit 1;
} }
exit 0;
} }
my %peers; my %peers;

View File

@ -55,15 +55,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if ($? eq "0") { if ($? eq "0") {
if (`$NTPQ -np | wc -l` > 0) { if (`$NTPQ -np | wc -l` > 0) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no (unable to list peers)\n"; print "no (unable to list peers)\n";
exit 1;
} }
} else { } else {
print "no (ntpq not found)\n"; print "no (ntpq not found)\n";
exit 1;
} }
exit 0;
} }
my %peers; my %peers;

View File

@ -51,15 +51,13 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if ($? eq "0") { if ($? eq "0") {
if (`$NTPDC -c sysstats | wc -l` > 0) { if (`$NTPDC -c sysstats | wc -l` > 0) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no (unable to list system stats)\n"; print "no (unable to list system stats)\n";
exit 1;
} }
} else { } else {
print "no (ntpdc not found)\n"; print "no (ntpdc not found)\n";
exit 1;
} }
exit 0;
} }
my $queries = 0; my $queries = 0;

View File

@ -12,11 +12,10 @@ BEANCOUNTERS=/proc/user_beancounters
if [ "$1" == "autoconf" ]; then if [ "$1" == "autoconf" ]; then
if [ -e $BEANCOUNTERS ]; then if [ -e $BEANCOUNTERS ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ ! -r $BEANCOUNTERS ]; then if [ ! -r $BEANCOUNTERS ]; then

View File

@ -66,14 +66,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle # Check for DBD::Oracle
if (! eval "require DBD::Oracle;") { if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)"; print "no (DBD::Oracle not found)";
exit 1; exit 0;
} }
if ($dbh) { if ($dbh) {
print "yes\n"; print "yes\n";
exit 0; exit 0;
} else { } else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1; exit 0;
} }
} }

View File

@ -63,14 +63,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle # Check for DBD::Oracle
if (! eval "require DBD::Oracle;") { if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)"; print "no (DBD::Oracle not found)";
exit 1; exit 0;
} }
if ($dbh) { if ($dbh) {
print "yes\n"; print "yes\n";
exit 0; exit 0;
} else { } else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1; exit 0;
} }
} }

View File

@ -64,14 +64,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle # Check for DBD::Oracle
if (! eval "require DBD::Oracle;") { if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)"; print "no (DBD::Oracle not found)";
exit 1; exit 0;
} }
if ($dbh) { if ($dbh) {
print "yes\n"; print "yes\n";
exit 0; exit 0;
} else { } else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1; exit 0;
} }
} }

View File

@ -65,14 +65,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle # Check for DBD::Oracle
if (! eval "require DBD::Oracle;") { if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)"; print "no (DBD::Oracle not found)";
exit 1; exit 0;
} }
if ($dbh) { if ($dbh) {
print "yes\n"; print "yes\n";
exit 0; exit 0;
} else { } else {
print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr; print "no Unable to access Database $dbname on host $dbhost as user $dbuser.\nError returned was: ". $DBI::errstr;
exit 1; exit 0;
} }
} }

View File

@ -46,11 +46,10 @@ if (defined $ARGV[0] and $ARGV[0] eq "autoconf")
if (defined $ret) if (defined $ret)
{ {
print "no ($ret)\n"; print "no ($ret)\n";
exit 1;
} else { } else {
print "yes\n"; print "yes\n";
exit 0;
} }
exit 0;
} }
if (defined $ARGV[0] and $ARGV[0] eq "config") if (defined $ARGV[0] and $ARGV[0] eq "config")

View File

@ -228,11 +228,10 @@ if (defined $ARGV[0] && $ARGV[0] eq 'autoconf') {
my $response = $ua->get($url); my $response = $ua->get($url);
if ($response->is_success) { if ($response->is_success) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no: unable to connect to url: $url\n"; print "no: unable to connect to url: $url\n";
exit 1;
} }
exit 0;
} }
=head2 Suggest Check =head2 Suggest Check

View File

@ -81,31 +81,31 @@ case $1 in
# enabled? # enabled?
if [ `${pfctl} -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `${pfctl} -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8))" echo "no (pf(4) is not enabled, consult pfctl(8))"
exit 1 exit 0
fi fi
# FreeBSD # FreeBSD
elif [ ${ostype} = "FreeBSD" ]; then elif [ ${ostype} = "FreeBSD" ]; then
# enabled? # enabled?
if [ `${pfctl} -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `${pfctl} -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8))" echo "no (pf(4) is not enabled, consult pfctl(8))"
exit 1 exit 0
fi fi
# OpenBSD # OpenBSD
elif [ ${ostype} = "OpenBSD" ]; then elif [ ${ostype} = "OpenBSD" ]; then
# pf(4) module loaded? # pf(4) module loaded?
if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then
echo "no (pf(4) is not loaded)" echo "no (pf(4) is not loaded)"
exit 1 exit 0
fi fi
# enabled? # enabled?
if [ `${pfctl} -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `${pfctl} -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8))" echo "no (pf(4) is not enabled, consult pfctl(8))"
exit 1 exit 0
fi fi
# Other OSes # Other OSes
else else
echo "no (this plugin is not supported on your OS)" echo "no (this plugin is not supported on your OS)"
exit 1 exit 0
fi fi
echo "yes" echo "yes"
exit 0 exit 0

View File

@ -51,12 +51,12 @@ END {
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# Other OSes # Other OSes
else else
echo "no (this plugin is not supported on your OS)" echo "no (this plugin is not supported on your OS)"
exit 1 exit 0
fi fi
echo "yes" echo "yes"
exit 0 exit 0

View File

@ -48,24 +48,24 @@ EOF
# pf(4) module loaded? # pf(4) module loaded?
if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then
echo "no (pf(4) is not loaded)" echo "no (pf(4) is not loaded)"
exit 1 exit 0
fi fi
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# OpenBSD # OpenBSD
elif [ ${ostype} = "OpenBSD" ]; then elif [ ${ostype} = "OpenBSD" ]; then
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# Other OSes # Other OSes
else else
echo "no (this plugin is not supported on your OS)" echo "no (this plugin is not supported on your OS)"
exit 1 exit 0
fi fi
echo "yes" echo "yes"
exit 0 exit 0

View File

@ -50,24 +50,24 @@ END {
# pf(4) module loaded? # pf(4) module loaded?
if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then
echo "no (pf(4) is not loaded)" echo "no (pf(4) is not loaded)"
exit 1 exit 0
fi fi
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# OpenBSD # OpenBSD
elif [ ${ostype} = "OpenBSD" ]; then elif [ ${ostype} = "OpenBSD" ]; then
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# Other OSes # Other OSes
else else
echo "no (this plugin is not supported on your OS)" echo "no (this plugin is not supported on your OS)"
exit 1 exit 0
fi fi
echo "yes" echo "yes"
exit 0 exit 0

View File

@ -44,24 +44,24 @@ ${pfctl} -sm 2> /dev/null | awk '
# pf(4) module loaded? # pf(4) module loaded?
if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then if [ `kldstat -v | grep pf | wc -l` -eq 0 ]; then
echo "no (pf(4) is not loaded)" echo "no (pf(4) is not loaded)"
exit 1 exit 0
fi fi
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# OpenBSD # OpenBSD
elif [ ${ostype} = "OpenBSD" ]; then elif [ ${ostype} = "OpenBSD" ]; then
# enabled? # enabled?
if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then if [ `pfctl -si 2>/dev/null | awk '/^Status:/{print $2}'` != "Enabled" ]; then
echo "no (pf(4) is not enabled, consult pfctl(8)" echo "no (pf(4) is not enabled, consult pfctl(8)"
exit 1 exit 0
fi fi
# Other OSes # Other OSes
else else
echo "no (this plugin is not supported on your OS)" echo "no (this plugin is not supported on your OS)"
exit 1 exit 0
fi fi
echo "yes" echo "yes"
exit 0 exit 0

View File

@ -43,11 +43,10 @@ if [ "$1" = "autoconf" ]; then
test -d "$SESSDIR" > /dev/null 2>&1 test -d "$SESSDIR" > /dev/null 2>&1
if [ $? ]; then if [ $? ]; then
echo yes echo yes
exit 0
else else
echo "no (session directory not found)" echo "no (session directory not found)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -40,11 +40,10 @@ NBRPAGE=${nbrpage}
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -r "$LOG" ]; then if [ -r "$LOG" ]; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -68,11 +68,10 @@ if ((exists $ARGV[0]) && ($ARGV[0] eq "autoconf")) {
my $ping = join(" ", @ping); my $ping = join(" ", @ping);
if ($ping =~ m@min/avg/max@) { if ($ping =~ m@min/avg/max@) {
print "yes\n"; print "yes\n";
exit 0;
} else { } else {
print "no\n"; print "no\n";
exit 1;
} }
exit 0;
} }
if ((exists $ARGV[0]) && ($ARGV[0] eq "config")) { if ((exists $ARGV[0]) && ($ARGV[0] eq "config")) {

View File

@ -67,11 +67,10 @@ case $1 in
which ping which ping
if [[ "$?" = "0" ]]; then if [[ "$?" = "0" ]]; then
echo yes echo yes
exit 0
else else
echo "no (ping not present)" echo "no (ping not present)"
exit 1
fi fi
exit 0
;; ;;
config) config)
cat << EOM cat << EOM

View File

@ -15,11 +15,10 @@ MYSQL_DB="postfixpolicyd"
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -n "${MYSQL_PASS}" ] ; then if [ -n "${MYSQL_PASS}" ] ; then
echo yes echo yes
exit 0
else else
echo "no (set mysql pass)" echo "no (set mysql pass)"
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -44,11 +44,10 @@ STATEFILE=$MUNIN_PLUGSTATE/postfix_mailfiltered.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -40,11 +40,10 @@ STATEFILE=$MUNIN_PLUGSTATE/postfix_mailfiltered_test.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -20,11 +20,10 @@ STATEFILE=$MUNIN_PLUGSTATE/postfix_mailfiltered.offset
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -62,7 +62,7 @@ sub autoconf
} else { } else {
print "no (could not find logdir)\n"; print "no (could not find logdir)\n";
} }
exit 1; exit 0;
} }
sub config sub config

View File

@ -133,7 +133,6 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf")
if (-r "$logfile") if (-r "$logfile")
{ {
print "yes\n"; print "yes\n";
exit 0;
} }
else else
{ {

View File

@ -20,11 +20,10 @@ LOGTAIL=${logtail:-`which logtail`}
if [ "$1" = "autoconf" ]; then if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes echo yes
exit 0
else else
echo no echo no
exit 1
fi fi
exit 0
fi fi
if [ "$1" = "config" ]; then if [ "$1" = "config" ]; then

View File

@ -47,12 +47,11 @@ my $passes_white_new=0;
if(defined $ARGV[0] and $ARGV[0] eq "autoconf") { if(defined $ARGV[0] and $ARGV[0] eq "autoconf") {
if ( -f $maillog) { if ( -f $maillog) {
print "yes\n"; print "yes\n";
exit 0;
} }
else { else {
print "no\n"; print "no\n";
exit 1
} }
exit 0;
} }

View File

@ -44,14 +44,13 @@ if (defined($ARGV[0]))
if (!$dbh) if (!$dbh)
{ {
print "no\n"; print "no\n";
exit 1;
} }
else else
{ {
print "yes\n"; print "yes\n";
exit 0;
} }
$dbh->disconnect(); $dbh->disconnect();
exit 0;
} }
if ($ARGV[0] eq 'config') if ($ARGV[0] eq 'config')

View File

@ -76,7 +76,7 @@ if (exists $ARGV[0]) {
# Check for DBD::Pg # Check for DBD::Pg
if (! eval "require DBD::Pg;") { if (! eval "require DBD::Pg;") {
print "no (DBD::Pg not found)"; print "no (DBD::Pg not found)";
exit 1; exit 0;
} }
# Then we try to detect Postgres presence by connecting to # Then we try to detect Postgres presence by connecting to
# 'template1'. # 'template1'.
@ -88,7 +88,7 @@ if (exists $ARGV[0]) {
exit 0; exit 0;
} else { } else {
print "no (Can't connect to given host, please check environment settings)\n"; print "no (Can't connect to given host, please check environment settings)\n";
exit 1; exit 0;
} }
} elsif ($ARGV[0] eq 'debug') { } elsif ($ARGV[0] eq 'debug') {
# Set debug flag # Set debug flag

Some files were not shown because too many files have changed in this diff Show More