thanks @hansome

does the above script put 1st ethernet port as WAN on router mode and in LAN when on ap mode ?