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 [ -r /proc/net/dev ]; then
$IPTABLES -L INPUT -v -n -x -w >/dev/null 2>/dev/null
if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)"
exit 1
else
echo yes
exit 0
if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)"
else
echo yes
fi
else
echo "no (/proc/net/dev not found)"
exit 1
fi
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

@ -37,11 +37,10 @@ mktempfile () {
if [ "$1" = "autoconf" ]; then
if [ -f "${AMAVIS_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" -a -n "${BC}" -a -x "${BC}" ] ; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
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 (-x "/usr/sbin/amavisd-agent") {
print "yes\n";
exit 0;
} else {
print "no (/usr/sbin/amavisd-agent not found or not executable)\n";
exit 1;
}
exit 0;
} elsif ($ARGV[0] and $ARGV[0] eq "suggest") {
print "time\n";
print "cache\n";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -29,7 +29,6 @@ mktempfile () {
if [ "$1" = "autoconf" ]; then
if [ -n "${B3NAME}" -a -f "${logfile}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ]; then
echo yes
exit 0
else
echo -n "no"
if [ ! -n "${B3NAME}" ]; then
@ -43,8 +42,8 @@ if [ "$1" = "autoconf" ]; then
elif [ ! -x "${LOGTAIL}" ]; then
echo " (cannot execute ${LOGTAIL})"
fi
exit 1
fi
exit 0
fi
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 (! -f $stat_file) {
printf "Unable to file bind stat file on %s",$stat_file;
exit 1;
exit 0;
}
if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1;
exit 0;
}
exit 0;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -147,12 +147,11 @@ if ( defined $ARGV[0] && $ARGV[0] eq 'autoconf' ) {
if ( !$@ && keys %stats ) {
print "yes\n";
exit 0;
}
else {
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 ($mdstat_present and ($detailed_present or $stat_present)) {
print "yes\n";
exit 0;
} else {
print "no\n";
}
print "no\n";
exit 1;
exit 0;
}
my %devs;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,11 +26,11 @@ case $1 in
autoconf|detect)
if [ -d $ICEDIR/ ] ; then
echo yes
exit 0
else
echo "no (icedir not found)"
exit 1
fi;;
fi
exit 0
;;
config)
cat <<'EOF'
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
if [ $? -gt 0 ]; then
echo "no (could not run ip6tables as user `whoami`)"
exit 1
else
echo yes
exit 0
fi
else
echo "no (/proc/net/dev not found)"
exit 1
fi
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,11 +19,10 @@ LOG=/etc/hosts.deny
if [ "$1" = "autoconf" ]; then
if [ -r "$LOG" ]; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
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 ($ret) {
print "no ($ret)\n";
exit 1;
} else {
print "yes\n";
exit 0;
}
exit 0;
}
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
if [ $? -ne 0 ]; then
echo no
exit 1
else
echo yes
exit 0
fi
exit 0
fi
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 ( ( $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");
exit 0;
} else {
print("no\n");
exit 1;
}
exit 0;
}
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 ( defined($host) and defined($port) and defined($username) and defined($password) ) {
print("yes\n");
exit 0;
} else {
print("no\n");
exit 1;
}
exit 0;
} elsif ( $ARGV[0] eq "config" ) {
print <<'END_GRAPH_CONFIG';
graph_title Flash Media Server application connections

View File

@ -201,11 +201,10 @@ if ( defined($ARGV[0]) ) {
if ( $ARGV[0] eq "autoconf" ) {
if ( defined($host) and defined($port) and defined($username) and defined($password) ) {
print("yes\n");
exit 0;
} else {
print("no\n");
exit 1;
}
exit 0;
} elsif ( $ARGV[0] eq "config" ) {
print <<'END_GRAPH_CONFIG';
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
if [ $? -gt 0 ]; then
echo "no (could not run iptables as user `whoami`)"
exit 1
else
echo yes
exit 0
fi
else
echo "no (/proc/net/dev not found)"
exit 1
fi
exit 0
fi
if [ "$1" = "suggest" ]; then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -23,11 +23,10 @@ case $1 in
autoconf)
if [ -r /proc/net/dev ]; then
echo yes
exit 0
else
echo "no (/proc/net/dev not found)"
exit 1
fi
exit 0
;;
suggest)
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 ($ret) {
print "no ($ret)\n";
exit 1;
} else {
print "yes\n";
}
print "yes\n";
exit 0;
}

View File

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

View File

@ -48,7 +48,7 @@ if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
{
if ($ret){
print "no ($ret)\n";
exit 1;
exit 0;
}
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)
{
print "no (no nginx status on $URL)\n";
exit 1;
exit 0;
}
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 ($ret) {
print "no ($ret)\n";
exit 1;
exit 0;
}
my $ua = LWP::UserAgent->new(timeout => 30);
# 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) {
print "no (no nginx status on $URL)\n";
exit 1;
exit 0;
} else {
print "yes\n";
exit 0;

View File

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

View File

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

View File

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

View File

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

View File

@ -66,14 +66,14 @@ if (exists $ARGV[0]) {
# Check for DBD::Oracle
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
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
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
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
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
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
if (! eval "require DBD::Oracle;") {
print "no (DBD::Oracle not found)";
exit 1;
exit 0;
}
if ($dbh) {
print "yes\n";
exit 0;
} else {
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)
{
print "no ($ret)\n";
exit 1;
} else {
print "yes\n";
exit 0;
}
exit 0;
}
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);
if ($response->is_success) {
print "yes\n";
exit 0;
} else {
print "no: unable to connect to url: $url\n";
exit 1;
}
exit 0;
}
=head2 Suggest Check

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,11 +20,10 @@ LOGTAIL=${logtail:-`which logtail`}
if [ "$1" = "autoconf" ]; then
if [ -f "${MAIL_LOG}" -a -n "${LOGTAIL}" -a -x "${LOGTAIL}" ] ; then
echo yes
exit 0
else
echo no
exit 1
fi
exit 0
fi
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 ( -f $maillog) {
print "yes\n";
exit 0;
}
else {
print "no\n";
exit 1
}
exit 0;
}

View File

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

View File

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

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