diff --git a/files/compress_stored_messages.sh b/files/compress_stored_messages.sh index 57ead89..129b004 100644 --- a/files/compress_stored_messages.sh +++ b/files/compress_stored_messages.sh @@ -1,7 +1,7 @@ #!/bin/bash - +set -euo pipefail FILTER_PATH='/var/spool/filter' while read -r FOLDER do tar cjf "${FOLDER}.tar.bz2" "${FOLDER}" &> /dev/null && rm -rf "${FOLDER}" -done <<< "$(find "${FILTER_PATH}/" -maxdepth 1 -type d -regex "^${FILTER_PATH}/2[0-9]*$")" \ No newline at end of file +done <<< "$(find "${FILTER_PATH}/" -maxdepth 1 -type d -regex "^${FILTER_PATH}/2[0-9]*$")" diff --git a/files/disclaimer.sh b/files/disclaimer.sh index 0236df3..7d9edb0 100644 --- a/files/disclaimer.sh +++ b/files/disclaimer.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail # http://www.postfix.org/FILTER_README.html # Clean up when done or when aborting. finished=false diff --git a/files/new_mail_user.sh b/files/new_mail_user.sh index b7ad0a0..6d535e3 100755 --- a/files/new_mail_user.sh +++ b/files/new_mail_user.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail # shellcheck disable=SC1091 [ -r /var/lib/from_repos/ad_scripts/shared_functions.sh ] && . /var/lib/from_repos/ad_scripts/shared_functions.sh diff --git a/files/remove_queued_messages.sh b/files/remove_queued_messages.sh index fb7f895..2b0e16f 100755 --- a/files/remove_queued_messages.sh +++ b/files/remove_queued_messages.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -euo pipefail if [[ "$1" == "" ]] then echo "Indicate a string to search in the postqueue." @@ -8,4 +9,4 @@ postqueue -p | grep -v '^-' | sed ':a;N;$!ba;s/\n\n/ENTER/g' | sed ':a;N;$!ba;s/ do echo "Removing message with ID '${KMSGID}'..." postsuper -d "$KMSGID" -done \ No newline at end of file +done diff --git a/files/update_clients.sh b/files/update_clients.sh index 26f60bb..36f3e0c 100644 --- a/files/update_clients.sh +++ b/files/update_clients.sh @@ -1,5 +1,5 @@ #!/bin/bash - +set -euo pipefail declare clients=( hiljainen.susurrando.com ) rm /etc/postfix/allowed_clients