Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 983dd745 authored by Felix's avatar Felix
Browse files

Revert broken commits by vincent

This reverts commit 97b7d2cd.
parent fb5b4ddd
Loading
Loading
Loading
Loading
+0 −23
Original line number Diff line number Diff line
@@ -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