Improve incorrect or unspecific output for "autoconf"

Some plugins emit wrongly formatted "no" messages or lack the "yes"
message on success.
This commit is contained in:
Lars Kruse 2018-09-16 04:09:21 +02:00
parent e4cd049b01
commit 2ec4e4c1f7
20 changed files with 68 additions and 99 deletions

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -28,16 +28,15 @@
if [ "$1" = "autoconf" ]; then
if [ -z "$(which amule)" ]; then
echo "$0: error: amule not installed"
exit 1
echo "no (amule not installed)"
else
if [ ! -e /tmp/amulesig.dat ]; then
echo "$0: error: amulesig.dat not found"
echo "no (amulesig.dat not found)"
else
echo yes
exit 0
fi
fi
exit 0
fi
if [ "$1" = "config" ]; then

View File

@ -122,12 +122,12 @@ 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;
printf "no (Unable to file bind stat file on %s)",$stat_file;
exit 0;
}
if (! -f $rndc) {
printf "Unable to file rndc tool (configured : %s)",$rndc;
exit 1;
printf "no (Unable to file rndc tool (configured : %s))",$rndc;
exit 0;
}
exit 0;
}

View File

@ -26,10 +26,10 @@ lvdisplay=$(which lvdisplay)
if [ "$1" = "autoconf" ]; then
if test -n "${lvdisplay}"; then
echo yes
exit 0
else
echo "no (lvdisplay not found)"
fi
echo "no lvdisplay found"
exit 1
exit 0
fi

View File

@ -13,11 +13,10 @@
if ($ARGV[0] and $ARGV[0] eq "autoconf") {
if (-r "/proc/mdstat" and `grep md /proc/mdstat`) {
print "yes\n";
exit 0;
} else {
print "no RAID devices\n";
exit 1;
print "no (no RAID devices found)\n";
}
exit 0;
}
if ( $ARGV[0] and $ARGV[0] eq "config" ) {

View File

@ -20,13 +20,12 @@ if ($ARGV[0] and $ARGV[0] eq "autoconf")
if (-r "/proc/fs/xfs/stat")
{
print "yes\n";
exit 0;
}
else
{
print "/proc/fs/xfs/stat not found\n";
exit 1;
print "no (/proc/fs/xfs/stat not found)\n";
}
exit 0;
}
my %runtime_stats = (

View File

@ -97,30 +97,20 @@ default_timeout=20
default_join_lines=true
if [ "${1}" = "autoconf" ]; then
result=0
if [ -z "${wget_bin}" -o ! -f "${wget_bin}" -o ! -x "${wget_bin}" ]; then
result=1
if [ -z "$wget_bin" ] || [ ! -f "$wget_bin" ] || [ ! -x "$wget_bin" ]; then
echo "no (missing 'wget' executable)"
elif [ -z "$time_bin" ] || [ ! -f "$time_bin" ] || [ ! -x "$time_bin" ]; then
echo "no (missing 'time' executable)"
elif [ -z "$mktemp_bin" ] || [ ! -f "$mktemp_bin" ] || [ ! -x "$mktemp_bin" ]; then
echo "no (missing 'mktemp' executable)"
elif [ -z "$grep_bin" ] || [ ! -f "$grep_bin" ] || [ ! -x "$grep_bin" ]; then
echo "no (missing 'grep' executable)"
elif [ -z "$tail_bin" ] || [ ! -f "$tail_bin" ] || [ ! -x "$tail_bin" ]; then
echo "no (missing 'tail' executable)"
else
if [ -z "${time_bin}" -o ! -f "${time_bin}" -o ! -x "${time_bin}" ]; then
result=2
else
if [ -z "${mktemp_bin}" -o ! -f "${mktemp_bin}" -o ! -x "${mktemp_bin}" ]; then
result=3
else
if [ -z "${grep_bin}" -o ! -f "${grep_bin}" -o ! -x "${grep_bin}" ]; then
result=4
else
[ -z "${tail_bin}" -o ! -f "${tail_bin}" -o ! -x "${tail_bin}" ] && result=5
fi
fi
fi
fi
if [ ${result} -eq 0 ]; then
echo "yes"
else
echo "no"
fi
exit $result
exit 0
fi
if [ -z "${names}" ]; then

View File

@ -60,13 +60,12 @@ default_args="--base 1000 -l 0"
default_scale="no"
if [ "${1}" = "autoconf" ]; then
result=0
if [ -z "${mysqlbin}" ]; then
echo "no"
echo "no (missing mysql executable)"
else
echo "yes"
fi
exit $result
exit 0
fi
if [ -z "${names}" ]; then

View File

@ -42,12 +42,10 @@ my $Channel="";
if ($ARGV[0] and $ARGV[0] eq "autoconf" ) {
if ( $SQLDBName ne "" ) {
print "yes\n";
exit 0;
} else {
print "no\n";
print "cannot find MythTV configuration file my.txt\n";
exit 1;
print "no (cannot find MythTV configuration file my.txt)\n";
}
exit 0;
}
#Config Options

View File

@ -71,7 +71,7 @@ LASTSTREAM=${#STREAMS[*]}
# --- check whether any stream found ---
run_autoconf() {
if (( $LASTSTREAM )) ; then echo yes ; exit 0 ; fi # found streams
echo U ; exit 1 ; } # no radio or streams
echo no ; exit 0 ; } # no radio or streams

View File

@ -34,9 +34,9 @@ LOGS=${logfile:-/var/log/apache2/error.log}
if [[ $1 == autoconf ]]; then
for LOG in $LOGS; do
if [[ ! -r $LOGS ]]; then
echo no
exit 1
if [[ ! -r $LOG ]]; then
echo "no (cannot read '$LOG')"
exit 0
fi
done

View File

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

View File

@ -87,26 +87,16 @@ ATUN=`$SNMPGET $fnVPNSslStatsActiveTunnels | cut -d ":" -f4 | cut -d " " -f2`
autoconf()
{
if [ $SCPU ]; then
echo yes, OID $FGTcpu can be readed.
if [ -z "$SCPU" ]; then
echo "no (one or multiple OID can not be read)"
elif [ -z "$SMEM" ]; then
echo "no (one or multiple OID can not be read)"
elif [ -z "$SCNT" ]; then
echo "no (one or multiple OID can not be read)"
else
echo no, one or multiple OID can not be readed.
exit 1
echo "yes"
fi
if [ $SMEM ]; then
echo yes, OID $fnSysMemUsage can be readed.
else
echo no, one or multiple OID can not be readed.
exit 1
fi
if [ $SCNT ]; then
echo yes, OID $fnSysSesCount can be readed.
else
echo no, one or multiple OID can not be read.
exit 1
fi
exit 0
exit 0
}
config()

View File

@ -12,13 +12,12 @@ if [ "$1" = 'autoconf' ]; then
if [ $zones -gt 1 ]; then
echo yes
else
echo yes
echo no
fi
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = 'config' ]; then

View File

@ -14,13 +14,12 @@ if [ "$1" = 'autoconf' ]; then
if [ $zones -gt 1 ]; then
echo yes
else
echo yes
echo no
fi
exit 0
else
echo no
exit 1
fi
exit 0
fi
if [ "$1" = 'config' ]; then

View File

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

View File

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

View File

@ -119,11 +119,10 @@ if [ "$1" = "autoconf" ]; then
get_infos
if [ -n "$summary" ]; then
echo yes
exit 0
else
echo "Cannot connect to ESX server $HOST"
exit 1
echo "no (cannot connect to ESX server $HOST)"
fi
exit 0
fi
if [ "$1" = "config" ]; then