3

I'm trying to set up a Systemd service that would restart my VPN connection (ProtonVPN) after resuming from suspend. The command that does what I need is sudo protonvpn r. So here is what I did: I created a service /etc/systemd/system/protonvpn-restart.service, containing the following:

[Unit]
Description=Restart ProtonVPN after suspend
After=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

[Service]
ExecStart=/bin/pvpn-resume
User=root

[Install]
WantedBy=suspend.target hibernate.target hybrid-sleep.target suspend-then-hibernate.target

and a script /bin/pvpn-resume (I made sure it was executable) containing the following:

#!/bin/sh

protonvpn r

Then I ran sudo systemctl start protonvpn-restart.service && sudo systemctl enable protonvpn-restart.service. But in the end, when I suspend and come back, the VPN doesn't restart and I my Internet won't work until I run manually sudo protonvpn r. Can anyone help?

Ul Tome
  • 133
  • 1
  • 2
  • 8
  • Dude did you find a solution to this? Because I want to the same, but i can't just a beginner. Anyway you could try posting these on: https://www.reddit.com/r/ProtonVPN/ .I'll do it later – Manguera v Nov 14 '20 at 15:30
  • This post has a solution to this: https://www.reddit.com/r/ProtonVPN/comments/i2f7j5/solution_to_reconnecting_protonvpn_after/ . Maybe you can look up for it, and if it's not working either, then you can try post a question in protonvpn reddit or github issues. – Manguera v Nov 14 '20 at 15:47
  • Wow thank you so much, it works like a charm!! I'll mark this thread as solved and it's thanks to you! – Ul Tome Nov 15 '20 at 17:53

0 Answers0