Helper to Automate spinning up and shutting down WireGuard tunnel via Tasker Automation (or compatible API)
I usually don’t do Android apps or Kotlin so feel free to improve on this.
This section needs to be updated. I use a MacroDroid with Android QuickTile and with following config.
NOTE: Asgard is both name of my home server and the tunnel.
net.evolution515.taskerwgtunnel/.MainActivity$IntentReceiver
com.wireguard.android.action.SET_TUNNEL_UP
tunnel="Asgard"
Additionally I use a Termux script (.termux/tasker/sleep-asgard
).
!#/bin/sh
ssh asgard "(sleep 1; sudo pm-suspend) & disown" &
termux-toast -s "Asgard is now asleep"
You can use something like that for debugging
am broadcast -a com.wireguard.android.action.SET_TUNNEL_UP -n 'net.evolution515.taskerwgtunnel/.MainActivity$IntentReceiver' --es tunnel Asgard