问题描述
我正在尝试建立一个Systemd服务,该服务将从挂起状态恢复后重新启动我的VPN连接(ProtonVPN)。
我需要执行的命令是sudo protonvpn r
。
因此,这就是我的工作:我创建了一个服务/etc/systemd/system/protonvpn-restart.service
,其中包含以下内容:
[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
和包含以下内容的脚本/bin/pvpn-resume
(我确定它是可执行的):
#!/bin/sh
protonvpn r
然后我运行了sudo systemctl start protonvpn-restart.service && sudo systemctl enable protonvpn-restart.service
。
但是最后,当我暂停并返回时,VPN不会重新启动,并且直到手动sudo protonvpn r
才能运行Internet。
有人可以帮忙吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)