Deal reached to end shutdown