diff options
author | Luke Bratch <luke@bratch.co.uk> | 2018-11-21 23:02:12 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2018-11-21 23:02:12 +0000 |
commit | 229a87c330033463046ca8fbd3a397ea12d0e196 (patch) | |
tree | 8f0fd532382af43e2cd26283c5be07fb6c6cbeca /certexpiry.sh | |
parent | 607cb60110fab704bfa58668fbe2681df9fe0fd4 (diff) |
Use $(()) instead of $(expr)
Diffstat (limited to 'certexpiry.sh')
-rwxr-xr-x | certexpiry.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/certexpiry.sh b/certexpiry.sh index ea2feeb..72ef8f8 100755 --- a/certexpiry.sh +++ b/certexpiry.sh @@ -59,14 +59,14 @@ while read HOSTANDPORT ; do # echo "DEBUG: NOW: $NOW." # Number of seconds left - DIFFERENCE=$(expr "$EXPIRY" - "$NOW") + DIFFERENCE=$(("$EXPIRY" - "$NOW")) # echo "DEBUG: DIFFERENCE: $DIFFERENCE." # Warn if less than WARNSECONDS less if [ "$DIFFERENCE" -lt "$WARNSECONDS" ] ; then - echo "Warning! The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$(expr $DIFFERENCE / 60 / 60 / 24) days)." + echo "Warning! The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$((DIFFERENCE / 60 / 60 / 24)) days)." # else -# echo "DEBUG: The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$(expr $DIFFERENCE / 60 / 60 / 24) days)." +# echo "DEBUG: The certificate at $HOST:$PORT expires in $DIFFERENCE seconds (~$((DIFFERENCE / 60 / 60 / 24)) days)." fi done < "$HOSTSANDPORTS" |