diff --git a/commands/exim_forwardadd.sh b/commands/exim_forwardadd.sh index 597ad93..a5f7d0e 100644 --- a/commands/exim_forwardadd.sh +++ b/commands/exim_forwardadd.sh @@ -6,4 +6,4 @@ echo "Forward TO email: " read emailto DIR=/etc/exim4/forward -echo "$(cat $DIR/$emailfrom)$emailto," > "$DIR/$emailfrom" +echo "$([[ -f $DIR/$emailfrom ]] && cat $DIR/$emailfrom)$emailto," > "$DIR/$emailfrom" diff --git a/commands/exim_forwarddel.sh b/commands/exim_forwarddel.sh index dc9f1eb..b3448bc 100644 --- a/commands/exim_forwarddel.sh +++ b/commands/exim_forwarddel.sh @@ -7,4 +7,4 @@ read emailto DIR=/etc/exim4/forward sed -i "s/$emailto,//g" "$DIR/$emailfrom" -[[ ! -s $DIR/$emailfrom ]] && rm -f $DIR/$emailfrom +[[ ! -s "$DIR/$emailfrom" ]] && rm -f "$DIR/$emailfrom" diff --git a/commands/exim_forwardlist.sh b/commands/exim_forwardlist.sh index c45bb0b..cc319df 100644 --- a/commands/exim_forwardlist.sh +++ b/commands/exim_forwardlist.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash DIR=/etc/exim4/forward -for file in $DIR/* +for file in "$DIR/*" do echo "$file: $(cat $DIR/$file)" done diff --git a/commands/exim_userdel.sh b/commands/exim_userdel.sh index 567d132..2eb7160 100644 --- a/commands/exim_userdel.sh +++ b/commands/exim_userdel.sh @@ -7,6 +7,6 @@ read domain DIR=/etc/exim4/domains sed -i "/$username/d" "$DIR/$domain" -[[ ! -s $DIR/$domain ]] && rm -f $DIR/$domain +[[ ! -s "$DIR/$domain" ]] && rm -f "$DIR/$domain" userdb "$username@$domain" del makeuserdb