AP + Client switch with button

As we have established in your other thread, you are using OpenWrt 15.05 (Chaos Calmer) which is totally obsolete. As I said in that thread, a lot has changed since 15.05 and the methods that would be employed in the current versions probably won't work with such an old version. And what worked in that version likely wouldn't work in a current version.

You may find some kind person here who both remembers and is willing to help with this ancient version, but I wouldn't rely on that. You will probably be best served by using the forum search to find similar scripts and then modifying them to suit your needs... a lot of this will require experimentation and trial-and-error tests.