From 403c6a83bce56f44be4e12dcc6d6459b1acb8f66 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Mon, 22 Feb 2021 17:58:10 +0900 Subject: [PATCH] SlackStatus: Prevent error output when expiry is empty This can cause issues if the user wants to parse the server reponse --- src/set-slack-status/default.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)