missing quotes and fix cat no such file or directory
This commit is contained in:
parent
f220f20894
commit
df301bda3a
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user