Correction bug suppression totale des confs

This commit is contained in:
Adrien Bourmault 2023-10-09 23:06:22 +02:00
parent 69cc961382
commit 37cfe6d33f
Signed by: neox
GPG Key ID: 2974E1D5F25DFCC8
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ if grep -q -e ^$user: /etc/passwd ; then
echo -n "Deleting mail from member list..."
pos=$(grep --line-number $user /etc/postfix/virtual_members | cut -d ":" -f 1)
if [ -n $pos ] ; then
if [ -n $pos ] && [ "$pos" -eq "$pos" ] ; then
echo Found at pos $pos
sed -i "${pos}d" /etc/postfix/virtual_members
postmap /etc/postfix/virtual_members
@ -29,7 +29,7 @@ if grep -q -e ^$user: /etc/passwd ; then
# Del account from any redirect (if exist)
echo -n "Deleting mail from member list..."
pos=$(grep --line-number $user /etc/postfix/virtual_redirect | cut -d ":" -f 1)
if [ -n $pos ] ; then
if [ -n $pos ] && [ "$pos" -eq "$pos" ] ; then
echo Found at pos $pos
sed -i "${pos}d" /etc/postfix/virtual_redirect
postmap /etc/postfix/virtual_redirect