This is my updated version of the script found here...
https://android.stackexchange.com/questions/37141/how-to-use-android-in-wi-fi-repeater-mode-by-bridging-wi-fi-with-access-point
Tested on Android 8.1 and 9 running Lineage/AOSP based roms.
Sets up wifi repeater matching channel and GHz of current connection.