fcd74cd7cf
- 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
38 lines
553 B
Bash
38 lines
553 B
Bash
#! /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
|
|
|