I have a really simple shell script, that just adds a route to my internal development machine. This is useful, as that machine has some LXC containers inside, so I can reach all my containers from my cell phone (to test websites from mobile browser, or Asterisk SIP accounts from CSipSimple)
#!/system/bin/sh su -c "ip route add 10.0.3.0/24 via 192.168.0.200 dev wlan0"
To use this rule, I've created a new Local connection on ConnectBot, with the script name as login command. This works great.
However, I'm too lazy. I just want to know if there is some way to apply this script, as soon as I connect to my home WiFi automatically. Maybe something to execute a script on every network change, as I could check from same script if I'm connected to my home WiFi using dumpsys and some grep magic.