From 2fcb1fff2d1faf0fa72c87e0f23885da7e35f2cae518920cbc1b1f8dcb7ea772 Mon Sep 17 00:00:00 2001 From: Reinhard Max Date: Mon, 26 Apr 2021 07:00:42 +0000 Subject: [PATCH] Accepting request 888332 from home:cboltz:branches:network:vpn - update 'rcopenvpn' to work without /etc/rc.status (boo#1185273) OBS-URL: https://build.opensuse.org/request/show/888332 OBS-URL: https://build.opensuse.org/package/show/network:vpn/openvpn?expand=0&rev=158 --- openvpn.changes | 5 +++++ openvpn.spec | 2 +- rcopenvpn | 19 ++++++++----------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/openvpn.changes b/openvpn.changes index e8d2c1f..a60d353 100644 --- a/openvpn.changes +++ b/openvpn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Apr 25 19:24:56 UTC 2021 - Christian Boltz + +- update 'rcopenvpn' to work without /etc/rc.status (boo#1185273) + ------------------------------------------------------------------- Wed Jan 6 17:15:13 UTC 2021 - Dirk Müller diff --git a/openvpn.spec b/openvpn.spec index 2444830..cdaefbd 100644 --- a/openvpn.spec +++ b/openvpn.spec @@ -32,7 +32,7 @@ Name: openvpn Version: 2.4.10 Release: 0 Summary: Full-featured SSL VPN solution using a TUN/TAP Interface -License: SUSE-GPL-2.0-with-openssl-exception AND LGPL-2.1-only +License: LGPL-2.1-only AND SUSE-GPL-2.0-with-openssl-exception Group: Productivity/Networking/Security URL: http://openvpn.net/ Source: https://swupdate.openvpn.org/community/releases/openvpn-%{version}.tar.xz diff --git a/rcopenvpn b/rcopenvpn index 099a736..04ba070 100644 --- a/rcopenvpn +++ b/rcopenvpn @@ -1,13 +1,12 @@ #! /bin/bash -SYSTEMD_NO_WRAP=1 . /etc/rc.status -rc_reset - action=$1 ; shift config=$1 ; shift +retcode=0 + if test -n "$config" ; then - systemctl "${action}" "openvpn@${config}.service" + systemctl "${action}" "openvpn@${config}.service" || retcode=$? else case $action in status) @@ -16,16 +15,14 @@ else for s in ${l#ConsistsOf=} ; do case $s in openvpn@*.service) - systemctl status "$s" - rc_check + systemctl status "$s" || retcode=$? ((++n)) ;; esac done - if test $n -gt 0 ; then - rc_status - else - rc_status -u + if test $n -eq 0 ; then + echo 'unused' >&2 + exit 3 fi ;; *) @@ -33,5 +30,5 @@ else ;; esac fi -rc_exit +exit $retcode