diff --git a/send-notification.sh b/send-notification.sh index 1ba25db..fb8af3e 100644 --- a/send-notification.sh +++ b/send-notification.sh @@ -10,6 +10,7 @@ # # Possible usages: see usage_help() +set -eu readonly PROGNAME=$(basename $0) readonly PROGDIR=$(readlink -m $(dirname $0)) @@ -119,7 +120,7 @@ fi ## MESSAGE_TO_SEND="" -if [ "${1}" ]; then # Message en tant qu'argument de la ligne de commande +if [ $# -ge 1 ] && [ "${1}" ]; then # Message en tant qu'argument de la ligne de commande MESSAGE_TO_SEND="${1}" else # Message lu de STDIN while read line