forked from pool/openvpn
Accepting request 211245 from home:mtomaschewski:branches:network:vpn
- Readded rcopenvpn helper script under systemd (bnc#848070) - Fixed a typo OBS-URL: https://build.opensuse.org/request/show/211245 OBS-URL: https://build.opensuse.org/package/show/network:vpn/openvpn?expand=0&rev=69
This commit is contained in:
parent
3e9aee291c
commit
fcd74cd7cf
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 17 15:26:16 UTC 2013 - mt@suse.de
|
||||||
|
|
||||||
|
- Readded rcopenvpn helper script under systemd (bnc#848070)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Oct 31 18:45:02 UTC 2013 - mt@suse.de
|
Thu Oct 31 18:45:02 UTC 2013 - mt@suse.de
|
||||||
|
|
||||||
|
@ -45,6 +45,7 @@ Source7: %{name}.keyring
|
|||||||
Source8: %{name}.service
|
Source8: %{name}.service
|
||||||
Source9: %{name}.target
|
Source9: %{name}.target
|
||||||
Source10: %{name}-tmpfile.conf
|
Source10: %{name}-tmpfile.conf
|
||||||
|
Source11: rc%{name}
|
||||||
Patch1: %{name}-2.3-plugin-man.dif
|
Patch1: %{name}-2.3-plugin-man.dif
|
||||||
Patch5: %{name}-2.3.0-man-dot.diff
|
Patch5: %{name}-2.3.0-man-dot.diff
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
@ -155,6 +156,7 @@ mkdir -p $RPM_BUILD_ROOT/%{_datadir}/openvpn
|
|||||||
%if %{with_systemd}
|
%if %{with_systemd}
|
||||||
install -D -m 644 $RPM_SOURCE_DIR/%{name}.service %{buildroot}/%{_unitdir}/%{name}@.service
|
install -D -m 644 $RPM_SOURCE_DIR/%{name}.service %{buildroot}/%{_unitdir}/%{name}@.service
|
||||||
install -D -m 644 $RPM_SOURCE_DIR/%{name}.target %{buildroot}/%{_unitdir}/%{name}.target
|
install -D -m 644 $RPM_SOURCE_DIR/%{name}.target %{buildroot}/%{_unitdir}/%{name}.target
|
||||||
|
install -D -m 755 $RPM_SOURCE_DIR/rc%{name} %{buildroot}%{_sbindir}/rc%{name}
|
||||||
# tmpfiles.d
|
# tmpfiles.d
|
||||||
mkdir -p %{buildroot}%{_libexecdir}/tmpfiles.d
|
mkdir -p %{buildroot}%{_libexecdir}/tmpfiles.d
|
||||||
install -m 0644 $RPM_SOURCE_DIR/%{name}-tmpfile.conf %{buildroot}%{_libexecdir}/tmpfiles.d/%{name}.conf
|
install -m 0644 $RPM_SOURCE_DIR/%{name}-tmpfile.conf %{buildroot}%{_libexecdir}/tmpfiles.d/%{name}.conf
|
||||||
@ -248,8 +250,8 @@ rm -f /etc/sysconfig/openvpn || :
|
|||||||
%else
|
%else
|
||||||
%config %{_sysconfdir}/init.d/openvpn
|
%config %{_sysconfdir}/init.d/openvpn
|
||||||
/var/adm/fillup-templates/sysconfig.openvpn
|
/var/adm/fillup-templates/sysconfig.openvpn
|
||||||
%{_sbindir}/rcopenvpn
|
|
||||||
%endif
|
%endif
|
||||||
|
%{_sbindir}/rcopenvpn
|
||||||
%{_sbindir}/openvpn
|
%{_sbindir}/openvpn
|
||||||
%attr(0750,root,root) %dir %ghost %{_localstatedir}/run/openvpn
|
%attr(0750,root,root) %dir %ghost %{_localstatedir}/run/openvpn
|
||||||
%{_includedir}/%{name}-plugin.h
|
%{_includedir}/%{name}-plugin.h
|
||||||
|
37
rcopenvpn
Normal file
37
rcopenvpn
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
SYSTEMD_NO_WRAP=1 . /etc/rc.status
|
||||||
|
rc_reset
|
||||||
|
|
||||||
|
action=$1 ; shift
|
||||||
|
config=$1 ; shift
|
||||||
|
|
||||||
|
if test -n "$config" ; then
|
||||||
|
systemctl "${action}" "openvpn@${config}.service"
|
||||||
|
else
|
||||||
|
case $action in
|
||||||
|
status)
|
||||||
|
n=0
|
||||||
|
l=`systemctl show -p ConsistsOf openvpn.target 2>/dev/null`
|
||||||
|
for s in ${l#ConsistsOf=} ; do
|
||||||
|
case $s in
|
||||||
|
openvpn@*.service)
|
||||||
|
systemctl status "$s"
|
||||||
|
rc_check
|
||||||
|
((++n))
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
if test $n -gt 0 ; then
|
||||||
|
rc_status
|
||||||
|
else
|
||||||
|
rc_status -u
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
systemctl "${action}" "openvpn.target"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
rc_exit
|
||||||
|
|
Loading…
Reference in New Issue
Block a user