26 lines
320 B
Markdown
26 lines
320 B
Markdown
|
|
||
|
|
||
|
```shell
|
||
|
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
|
||
|
|
||
|
|
||
|
```
|
||
|
|