I already experienced the timing issue alshao mentioned. Furtonately I edited the script in such a way that it didn’t reset the router to its default settings, but I discovered the timing is really difficult.