384 B
384 B
sudo vim /usr/lib/systemd/system/openvpnclient.service
[Unit]
Description=OpenVPNClient
[Service]
Type=simple
ExecStart=openvpn /etc/openvpn/client/server001.ovpn
ExecStop=/usr/bin/killall openvpn
Restart=always
User=root
[Install]
WantedBy=multi-user.target
##刷新
sudo systemctl daemon-reload
#开启开机重启
sudo systemctl enable openvpnclient.service