diff --git a/Applications/Template_App_Speedtest_Wan/6.0/record_speedtest.sh b/Applications/Template_App_Speedtest_Wan/6.0/record_speedtest.sh index 091a5f654..23acce79c 100755 --- a/Applications/Template_App_Speedtest_Wan/6.0/record_speedtest.sh +++ b/Applications/Template_App_Speedtest_Wan/6.0/record_speedtest.sh @@ -49,22 +49,22 @@ OUTFILE=$($MKTEMP) # what time is it? NOW=$($DATE +%s) -$TIMEOUT $TIMEOUTTIME $SPEEDTEST $SPEEDTESTPARAMS -f json 2>/dev/null > $OUTFILE -if [ $($STAT -c %s $OUTFILE) -le 100 ];then +"$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 fi -F="$($CAT $OUTFILE)" +F="$($CAT "$OUTFILE")" # do we have PSKID and PSKFILE? -if [ -f "$PSKFILE" -a -n "$PSKID" ];then +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 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 fi -$RM -f $OUTFILE +$RM -f "$OUTFILE" \ No newline at end of file diff --git a/Applications/Template_App_Speedtest_Wan/6.2/record_speedtest.sh b/Applications/Template_App_Speedtest_Wan/6.2/record_speedtest.sh index 091a5f654..23acce79c 100755 --- a/Applications/Template_App_Speedtest_Wan/6.2/record_speedtest.sh +++ b/Applications/Template_App_Speedtest_Wan/6.2/record_speedtest.sh @@ -49,22 +49,22 @@ OUTFILE=$($MKTEMP) # what time is it? NOW=$($DATE +%s) -$TIMEOUT $TIMEOUTTIME $SPEEDTEST $SPEEDTESTPARAMS -f json 2>/dev/null > $OUTFILE -if [ $($STAT -c %s $OUTFILE) -le 100 ];then +"$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 fi -F="$($CAT $OUTFILE)" +F="$($CAT "$OUTFILE")" # do we have PSKID and PSKFILE? -if [ -f "$PSKFILE" -a -n "$PSKID" ];then +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 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 fi -$RM -f $OUTFILE +$RM -f "$OUTFILE" \ No newline at end of file diff --git a/Applications/Template_App_Speedtest_Wan/6.4/record_speedtest.sh b/Applications/Template_App_Speedtest_Wan/6.4/record_speedtest.sh index 091a5f654..23acce79c 100755 --- a/Applications/Template_App_Speedtest_Wan/6.4/record_speedtest.sh +++ b/Applications/Template_App_Speedtest_Wan/6.4/record_speedtest.sh @@ -49,22 +49,22 @@ OUTFILE=$($MKTEMP) # what time is it? NOW=$($DATE +%s) -$TIMEOUT $TIMEOUTTIME $SPEEDTEST $SPEEDTESTPARAMS -f json 2>/dev/null > $OUTFILE -if [ $($STAT -c %s $OUTFILE) -le 100 ];then +"$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 fi -F="$($CAT $OUTFILE)" +F="$($CAT "$OUTFILE")" # do we have PSKID and PSKFILE? -if [ -f "$PSKFILE" -a -n "$PSKID" ];then +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 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 fi -$RM -f $OUTFILE +$RM -f "$OUTFILE" \ No newline at end of file diff --git a/Applications/Template_App_Speedtest_Wan/7.0/record_speedtest.sh b/Applications/Template_App_Speedtest_Wan/7.0/record_speedtest.sh index 091a5f654..23acce79c 100755 --- a/Applications/Template_App_Speedtest_Wan/7.0/record_speedtest.sh +++ b/Applications/Template_App_Speedtest_Wan/7.0/record_speedtest.sh @@ -49,22 +49,22 @@ OUTFILE=$($MKTEMP) # what time is it? NOW=$($DATE +%s) -$TIMEOUT $TIMEOUTTIME $SPEEDTEST $SPEEDTESTPARAMS -f json 2>/dev/null > $OUTFILE -if [ $($STAT -c %s $OUTFILE) -le 100 ];then +"$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 fi -F="$($CAT $OUTFILE)" +F="$($CAT "$OUTFILE")" # do we have PSKID and PSKFILE? -if [ -f "$PSKFILE" -a -n "$PSKID" ];then +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 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 fi -$RM -f $OUTFILE +$RM -f "$OUTFILE" \ No newline at end of file