Skip to content

Instantly share code, notes, and snippets.

@kai3341
Last active March 26, 2024 03:35
Show Gist options
  • Save kai3341/f8835f1f0487ea68b2dac6af608bb053 to your computer and use it in GitHub Desktop.
Save kai3341/f8835f1f0487ea68b2dac6af608bb053 to your computer and use it in GitHub Desktop.
openvpn
[Unit]
Description=OpenVPN Admin service for %I
After=network-online.target
After=openvpn@%i.service
Wants=network-online.target
Documentation=https://github.com/flant/ovpn-admin
[Service]
Type=simple
User=nobody
Group=nogroup
PrivateTmp=true
WorkingDirectory=/etc/ovpn-mgmt/%i
ExecStart=/usr/local/bin/ovpn-admin --easyrsa.bin-path=/usr/share/easy-rsa/easyrsa --templates.clientconfig-path=/etc/ovpn-mgmt/%i/client.tpl
EnvironmentFile=/etc/ovpn-mgmt/%i/ovpn-admin.env
ProtectSystem=true
ProtectHome=true
KillMode=process
RestartSec=5s
Restart=on-failure
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment