网络和openvpn不适用于hibernate脚本

时间:2013-12-21 13:06:04

标签: networking ubuntu openvpn hibernation

通过hibernate脚本挂起到磁盘后我无法访问互联网。这是因为我使用openvpn。停止网络,重新启动openvpn并启动网络可以解决问题。我想配置hibernate脚本来自动执行此操作。我尝试在RestartServices networking openvpn中设置hibernate.conf,但这不起作用(我认为这首先重新启动网络,然后是openvpn但我需要在其间重启openvpn)。

亲切的问候, 塞巴斯蒂安

1 个答案:

答案 0 :(得分:2)

As hibernate.conf doesn't seem to work我这样做了:

echo 'case "${1}" in
    hibernate|suspend)
    sudo service openvpn restart
    ;;
esac' | sudo tee /etc/pm/sleep.d/20_restart-openvpn
sudo chmod +x /etc/pm/sleep.d/20_restart-openvpn

这将创建一个名为“20_restart-openvpn”的脚本(您可以更改脚本的名称)并使其可执行。我希望这也可以帮到你......