The deal to save the chain will see more than 30 of its restaurants close.