Okay, I realised I might have misread the instructions for the script which take the WLAN0 ip of 192.168.43.1 and convert it to 192.168.43.0 for the script.
So I changed my script from 192.168.1.1 to 192.168.1.0 and my Invalid argument error is gone. But now when I try to connect to the wifi...
Not sure if anyone is still looking at this thread, but:
I'm trying to get this to work. If I paste the script into terminal emulator, all seems to be working until this line:
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
I get the error message: RNETLINK answers: Invalid argument...