An agreement has been reached in Ecuador to end a strike that had shut down oil exports from the country 's two largest oil-producing regions and had triggered violent protests .