Fix unbound variable errors

This commit is contained in:
2022-06-02 16:08:07 +02:00
parent a6eeccb417
commit 4f8c1b5388
15 changed files with 85 additions and 86 deletions

View File

@@ -31,7 +31,7 @@ seq_config() {
initSeqConfig "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
if [ $? -eq 0 ] ; then
CONFIG=1
info " Domain: $MAS_DOMAIN"
info " Domain: ${MAS_DOMAIN:-}"
elif [ $? -eq 1 ] ; then
# Config $CONFIG_FILE_NAME created. Needs modification first
dry || return -1
@@ -415,20 +415,19 @@ step_100_info() {
step_100_alias() { echo "test"; }
step_100() {
shift
local arg
local fromAdr
local toAdr="postmaster@$MAS_DOMAIN"
local asUser=
for arg in "$@" ; do
for _ in "$@" ; do
case "$1" in
-f)
shift
fromAdr="-f $1 "
fromAdr="-f ${1:-} "
shift
;;
-u)
shift
asUser="sudo -u $1 "
asUser="sudo -u ${1:-} "
shift
;;
*)
@@ -436,7 +435,7 @@ step_100() {
;;
esac
done
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
toAdr="$1"
fi
exe ${asUser}sh -c "echo \"Subject: Test from Postfix\nIt is \$(date)\n\nGreetings \$(whoami)\" | sendmail ${fromAdr}$toAdr"
@@ -456,7 +455,7 @@ step_104_alias() { echo "delqueue"; }
step_104() {
shift
local msgId="ALL"
if [ ! -z $1 ] ; then
if [ -n "${1:-}" ] ; then
msgId="$1"
fi
exe postsuper -d "$msgId"