Loading scripts/delete-account.sh +0 −23 Original line number Diff line number Diff line Loading @@ -19,28 +19,5 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then echo "Deleting email account" docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT" # Fix #951 FILE_MULTIPLE_REGISTRATION_CHECK=/mnt/repo-base/volumes/accounts/auth.file.done # delete line with $ACCOUNT : this is a e.email # strip "e.email" suffix MBOX=${ACCOUNT%"@e.email"} # sed pattern : \:$MBOX$ = # line line ending with $MBOX ($), # and ':' and : before $MBOX to prevent accidental deletion # ex : if $MBOX = doe do NOT delete all lines ending with "doe", "johndoe", "john-doe", only delete ":doe" # grep |wc -l >> count result, if one line delete if [[ $(grep -nR "\:$MBOX$" $FILE_MULTIPLE_REGISTRATION_CHECK |wc -l) = "1" ]]; then echo "Removing $MBOX from file $FILE_MULTIPLE_REGISTRATION_CHECK" sed -i "/\:$MBOX$/d" $FILE_MULTIPLE_REGISTRATION_CHECK elif [[ $(grep -nR "\:$MBOX$" $FILE_MULTIPLE_REGISTRATION_CHECK |wc -l) = "0" ]] then echo "$MBOX not found in $FILE_MULTIPLE_REGISTRATION_CHECK" else echo "More than one line to be deleted for $MBOX, check $FILE_MULTIPLE_REGISTRATION_CHECK please" fi # TODO: delete onlyoffice account??? fi Loading
scripts/delete-account.sh +0 −23 Original line number Diff line number Diff line Loading @@ -19,28 +19,5 @@ if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then echo "Deleting email account" docker-compose exec -T postfixadmin /postfixadmin/scripts/postfixadmin-cli mailbox delete "$ACCOUNT" # Fix #951 FILE_MULTIPLE_REGISTRATION_CHECK=/mnt/repo-base/volumes/accounts/auth.file.done # delete line with $ACCOUNT : this is a e.email # strip "e.email" suffix MBOX=${ACCOUNT%"@e.email"} # sed pattern : \:$MBOX$ = # line line ending with $MBOX ($), # and ':' and : before $MBOX to prevent accidental deletion # ex : if $MBOX = doe do NOT delete all lines ending with "doe", "johndoe", "john-doe", only delete ":doe" # grep |wc -l >> count result, if one line delete if [[ $(grep -nR "\:$MBOX$" $FILE_MULTIPLE_REGISTRATION_CHECK |wc -l) = "1" ]]; then echo "Removing $MBOX from file $FILE_MULTIPLE_REGISTRATION_CHECK" sed -i "/\:$MBOX$/d" $FILE_MULTIPLE_REGISTRATION_CHECK elif [[ $(grep -nR "\:$MBOX$" $FILE_MULTIPLE_REGISTRATION_CHECK |wc -l) = "0" ]] then echo "$MBOX not found in $FILE_MULTIPLE_REGISTRATION_CHECK" else echo "More than one line to be deleted for $MBOX, check $FILE_MULTIPLE_REGISTRATION_CHECK please" fi # TODO: delete onlyoffice account??? fi