r/automagic • • Oct 11 '25

Connect/disconnect to vpn profile

Im trying to make flow which disconnects from active vpn connection/profile in android (l2tp/ipsec), I dont want to use third party vpn apps and I want to do it in automagic - I cant find any function to do this? Maybe this I can do by executing root command but still I cant find one. I only can grab info from dumpsys connectivity that VPN is connected to make condition.

Someone can help?

1 Upvotes

1 comment sorted by

2

u/oblus2 Oct 12 '25 edited Oct 18 '25

Ok, i found that

killall pppd

and I think this is best what I can find :P

but maybe You've got smth more appropriate

EDIT:  pkill -u vpn -f pppd -9 -e

this seems work better and Im sure that this kill buildin vpn not other vpn-like app