diff options
author | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-01-27 23:32:42 -0800 |
---|---|---|
committer | jc_gargma <jc_gargma@iserlohn-fortress.net> | 2019-01-27 23:32:42 -0800 |
commit | 6f4508ab01a500e036a0fd6d208605f2fc68df68 (patch) | |
tree | 180072eda0a4d1d9a78e87fde002e6c046c0b009 | |
parent | backup function doesn't like aliases (diff) | |
download | openvpn-openrc-6f4508ab01a500e036a0fd6d208605f2fc68df68.tar.xz |
Use stock init and conf | Simplify PKGBUILD
-rw-r--r-- | PKGBUILD | 22 | ||||
-rw-r--r-- | openvpn.confd | 6 | ||||
-rwxr-xr-x | openvpn.initd | 12 |
3 files changed, 21 insertions, 19 deletions
@@ -3,24 +3,28 @@ # # I maintain this because: # Artix lacks this init script entirely -# Gentoo version doesn't support mulitple profiles +# Arch base package lacks a sysusers.d .conf -pkgname=openvpn-openrc _pkgname=openvpn +pkgname=${_pkgname}-openrc pkgver=20190127 pkgrel=1 -pkgdesc="OpenRC openvpn init script" +pkgdesc="OpenRC ${_pkgname} init script" arch=('any') url="https://neueland.iserlohn-fortress.net/gitea/jc_gargma" license=('GPL2') groups=('openrc-system') -depends=('openrc' 'openvpn') -backup=('etc/conf.d/openvpn') -source=("${_pkgname}.initd" +depends=('openrc' "${_pkgname}") +backup=( + "etc/conf.d/${_pkgname}" + ) +source=( + "${_pkgname}.initd" "${_pkgname}.confd" - "${_pkgname}.sysusersd") -sha256sums=('2187ce996f4d7b7409fdb097746a1ea678da6476adcaa3e6d019fe81ed09b4d9' - '852a0d5a3bb34d08d0fb33ad357810667917a3f5f6eb17ab636e6b7bc9da0c4c' + "${_pkgname}.sysusersd" + ) +sha256sums=('89f69bcd627868830c421bc6270f08a1c3edf1a1e5fbdedf33c7a7d530bdfccf' + '330149a83684ddabe413d134d4c8efad4c88b18c2ab67165014deff5f7fffad2' 'a7f0b7ec6d35985b23aee99c158fc3e0fe6aa659f142690a85ccd292b4118127') package() { diff --git a/openvpn.confd b/openvpn.confd index f4cefeb..72510c3 100644 --- a/openvpn.confd +++ b/openvpn.confd @@ -1,14 +1,14 @@ # OpenVPN automatically creates an /etc/resolv.conf (or sends it to # resolvconf) if given DNS information by the OpenVPN server. # Set PEER_DNS="no" to stop this. -PEER_DNS="no" +PEER_DNS="yes" # OpenVPN can run in many modes. Most people will want the init script # to automatically detect the mode and try and apply a good default # configuration and setup scripts. However, there are cases where the # OpenVPN configuration looks like a client, but it's really a peer or # something else. DETECT_CLIENT controls this behaviour. -DETECT_CLIENT="no" +DETECT_CLIENT="yes" # If DETECT_CLIENT is no and you have your own scripts to re-enter the openvpn # init script (ie, it first becomes "inactive" and the script then starts the @@ -16,5 +16,3 @@ DETECT_CLIENT="no" # In other words, unless you understand service dependencies and are a # competent shell scripter, don't set this. RE_ENTER="no" - -VPN="" diff --git a/openvpn.initd b/openvpn.initd index 3568a9f..b42aa13 100755 --- a/openvpn.initd +++ b/openvpn.initd @@ -1,13 +1,13 @@ -#!/usr/bin/openrc-run +#!/sbin/openrc-run # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 VPNDIR=${VPNDIR:-/etc/openvpn} -#VPN=${SVCNAME#*.} +VPN=${SVCNAME#*.} if [ -n "${VPN}" ] && [ ${SVCNAME} != "openvpn" ]; then - VPNPID="/run/openvpn.${VPN}.pid" + VPNPID="/var/run/openvpn.${VPN}.pid" else - VPNPID="/run/openvpn.pid" + VPNPID="/var/run/openvpn.pid" fi VPNCONF="${VPNDIR}/${VPN}.conf" @@ -110,7 +110,7 @@ start() { [ -n "${PEER_DNS}" ] && args="${args} --setenv PEER_DNS ${PEER_DNS}" [ "${reenter}" = "yes" ] && mark_service_inactive "${SVCNAME}" - start-stop-daemon --start --exec /usr/bin/openvpn --pidfile "${VPNPID}" \ + start-stop-daemon --start --exec /usr/sbin/openvpn --pidfile "${VPNPID}" \ -- --config "${VPNCONF}" --writepid "${VPNPID}" --daemon \ --setenv SVCNAME "${SVCNAME}" ${args} eend $? "Check your logs to see why startup failed" @@ -126,7 +126,7 @@ stop() { ebegin "Stopping ${SVCNAME}" start-stop-daemon --stop --quiet \ - --exec /usr/bin/openvpn --pidfile "${VPNPID}" + --exec /usr/sbin/openvpn --pidfile "${VPNPID}" eend $? } |