diff --git a/src/set-slack-status/default.sh b/src/set-slack-status/default.sh index ec83cb2..4c60bb7 100644 --- a/src/set-slack-status/default.sh +++ b/src/set-slack-status/default.sh @@ -19,7 +19,7 @@ if [[ ! -z "$KMPARAM_Status_text" || $both_empty -eq 0 ]]; then fi # Calculate expiration unixtime (if set to more than 0) -if [[ $(bc -l <<< "$KMPARAM_Clear_after_x_hours > 0") -eq 1 ]]; then +if [[ ! -z "$KMPARAM_Clear_after_x_hours" && $(bc -l <<< "$KMPARAM_Clear_after_x_hours > 0") -eq 1 ]]; then unix_now=$(date +%s) offset=$(bc -l <<< "$KMPARAM_Clear_after_x_hours * 3600") integer_offset=$(printf "%.0f" $offset)