Skip to content

Commit

Permalink
fix whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan committed Oct 28, 2024
1 parent 8011113 commit d521176
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 44 deletions.
22 changes: 11 additions & 11 deletions Applications/Template_App_Speedtest_Wan/6.0/record_speedtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ test -z "$EGREP" && echo "egrep binary not found" && exit
test -z "$RM" && echo "rm binary not found" && exit

if [ "$($SPEEDTEST -V | $EGREP -c 'Speedtest by Ookla')" -lt 1 ];then
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
fi

# Temporary speedtest output
Expand All @@ -51,20 +51,20 @@ NOW=$($DATE +%s)

"$TIMEOUT" "$TIMEOUTTIME" "$SPEEDTEST" "$SPEEDTESTPARAMS" -f json 2>/dev/null > "$OUTFILE"
if [ "$($STAT -c %s "$OUTFILE")" -le 100 ];then
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
fi

F="$($CAT "$OUTFILE")"

# do we have PSKID and PSKFILE?
if [ -f "$PSKFILE" ] && [ -n "$PSKID" ];then
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
else
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
fi
$RM -f "$OUTFILE"
22 changes: 11 additions & 11 deletions Applications/Template_App_Speedtest_Wan/6.2/record_speedtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ test -z "$EGREP" && echo "egrep binary not found" && exit
test -z "$RM" && echo "rm binary not found" && exit

if [ "$($SPEEDTEST -V | $EGREP -c 'Speedtest by Ookla')" -lt 1 ];then
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
fi

# Temporary speedtest output
Expand All @@ -51,20 +51,20 @@ NOW=$($DATE +%s)

"$TIMEOUT" "$TIMEOUTTIME" "$SPEEDTEST" "$SPEEDTESTPARAMS" -f json 2>/dev/null > "$OUTFILE"
if [ "$($STAT -c %s "$OUTFILE")" -le 100 ];then
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
fi

F="$($CAT "$OUTFILE")"

# do we have PSKID and PSKFILE?
if [ -f "$PSKFILE" ] && [ -n "$PSKID" ];then
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
else
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
fi
$RM -f "$OUTFILE"
22 changes: 11 additions & 11 deletions Applications/Template_App_Speedtest_Wan/6.4/record_speedtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ test -z "$EGREP" && echo "egrep binary not found" && exit
test -z "$RM" && echo "rm binary not found" && exit

if [ "$($SPEEDTEST -V | $EGREP -c 'Speedtest by Ookla')" -lt 1 ];then
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
fi

# Temporary speedtest output
Expand All @@ -51,20 +51,20 @@ NOW=$($DATE +%s)

"$TIMEOUT" "$TIMEOUTTIME" "$SPEEDTEST" "$SPEEDTESTPARAMS" -f json 2>/dev/null > "$OUTFILE"
if [ "$($STAT -c %s "$OUTFILE")" -le 100 ];then
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
fi

F="$($CAT "$OUTFILE")"

# do we have PSKID and PSKFILE?
if [ -f "$PSKFILE" ] && [ -n "$PSKID" ];then
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
else
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
fi
$RM -f "$OUTFILE"
22 changes: 11 additions & 11 deletions Applications/Template_App_Speedtest_Wan/7.0/record_speedtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ test -z "$EGREP" && echo "egrep binary not found" && exit
test -z "$RM" && echo "rm binary not found" && exit

if [ "$($SPEEDTEST -V | $EGREP -c 'Speedtest by Ookla')" -lt 1 ];then
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
echo "The speedtest binary needs to be from Ookla."
echo "Please visit https://www.speedtest.net/apps/cli"
exit
fi

# Temporary speedtest output
Expand All @@ -51,20 +51,20 @@ NOW=$($DATE +%s)

"$TIMEOUT" "$TIMEOUTTIME" "$SPEEDTEST" "$SPEEDTESTPARAMS" -f json 2>/dev/null > "$OUTFILE"
if [ "$($STAT -c %s "$OUTFILE")" -le 100 ];then
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
echo "ERROR running speedtest - output file too small - $OUTFILE"
echo "You may want to try running $SPEEDTEST -f json manually"
echo "and/or checking the contents of $OUTFILE"
exit
fi

F="$($CAT "$OUTFILE")"

# do we have PSKID and PSKFILE?
if [ -f "$PSKFILE" ] && [ -n "$PSKID" ];then
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER --tls-connect psk --tls-psk-identity "$PSKID" --tls-psk-file "$PSKFILE" -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
else
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[runtime]" -o "$NOW" > /dev/null 2>&1
$ZABBIX_SENDER -z "$ZABSRV" -s "$SPDHOST" -k "custom.speedtest[json]" -o "$F" > /dev/null 2>&1
fi
$RM -f "$OUTFILE"

0 comments on commit d521176

Please sign in to comment.