Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openconnect/files/
Date: Thu, 26 Jan 2017 04:06:21
Message-Id: 1485403573.d69a628145b8027fa256bdaf331d05608337c1b1.floppym@gentoo
1 commit: d69a628145b8027fa256bdaf331d05608337c1b1
2 Author: Michael Mair-Keimberger (asterix) <m.mairkeimberger <AT> gmail <DOT> com>
3 AuthorDate: Wed Jan 25 19:49:50 2017 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 26 04:06:13 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d69a6281
7
8 net-misc/openconnect: remove unused init files
9
10 net-misc/openconnect/files/openconnect.init.in-r2 | 144 ---------------------
11 net-misc/openconnect/files/openconnect.init.in-r3 | 145 ----------------------
12 2 files changed, 289 deletions(-)
13
14 diff --git a/net-misc/openconnect/files/openconnect.init.in-r2 b/net-misc/openconnect/files/openconnect.init.in-r2
15 deleted file mode 100644
16 index 338afb8..00000000
17 --- a/net-misc/openconnect/files/openconnect.init.in-r2
18 +++ /dev/null
19 @@ -1,144 +0,0 @@
20 -#!/sbin/openrc-run
21 -# Copyright 1999-2014 Gentoo Foundation
22 -# Distributed under the terms of the GNU General Public License v2
23 -# $Id$
24 -
25 -VPN="${RC_SVCNAME#*.}"
26 -VPNLOG="/var/log/openconnect/${VPN}"
27 -VPNLOGFILE="${VPNLOG}/openconnect.log"
28 -VPNERRFILE="${VPNLOG}/openconnect.err"
29 -VPNPID="/run/openconnect/${VPN}.pid"
30 -VPNDIR="/etc/openconnect/${VPN}"
31 -PREUPSCRIPT="${VPNDIR}/preup.sh"
32 -PREDOWNSCRIPT="${VPNDIR}/predown.sh"
33 -POSTUPSCRIPT="${VPNDIR}/postup.sh"
34 -POSTDOWNSCRIPT="${VPNDIR}/postdown.sh"
35 -SERVER="server_${VPN}"
36 -PASSWORD="password_${VPN}"
37 -VPNOPTS="vpnopts_${VPN}"
38 -
39 -depend() {
40 - before netmount
41 -}
42 -
43 -checkconfig() {
44 - if [ $VPN = "openconnect" ]; then
45 - eerror "You cannot call openconnect directly. You must create a symbolic link to it with the vpn name:"
46 - echo
47 - eerror "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
48 - echo
49 - eerror "And then call it instead:"
50 - echo
51 - eerror "/etc/init.d/openconnect.vpn0 start"
52 - return 1
53 - fi
54 -}
55 -
56 -checktuntap() {
57 - if [ $(uname -s) = "Linux" ] ; then
58 - if [ ! -e /dev/net/tun ]; then
59 - if ! modprobe tun ; then
60 - eerror "TUN/TAP support is not available in this kernel"
61 - return 1
62 - fi
63 - fi
64 - if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
65 - ebegin "Detected broken /dev/net/tun symlink, fixing..."
66 - rm -f /dev/net/tun
67 - ln -s /dev/misc/net/tun /dev/net/tun
68 - eend $?
69 - fi
70 - fi
71 -}
72 -
73 -start() {
74 - ebegin "Starting OpenConnect: ${VPN}"
75 -
76 - local tmp_SERVER tmp_VPNOPTS tmp_PASSWORD
77 - eval tmp_SERVER="\${${SERVER}}"
78 - eval tmp_VPNOPTS="\${${VPNOPTS}}"
79 - eval tmp_PASSWORD="\${${PASSWORD}}"
80 -
81 - checkconfig || return 1
82 -
83 - checktuntap || return 1
84 -
85 - if [ "${tmp_SERVER}" = "vpn.server.tld" ]; then
86 - eend 1 "${VPN} not configured"
87 - return 1
88 - fi
89 -
90 - if [ ! -e "${VPNLOG}" ]; then
91 - mkdir -p "${VPNLOG}"
92 - fi
93 -
94 - local piddir="${VPNPID%/*}"
95 - if [ ! -d "$piddir" ] ; then
96 - mkdir -p "$piddir"
97 - if [ $? -ne 0 ]; then
98 - eerror "Directory $piddir for pidfile does not exist and cannot be created"
99 - return 1
100 - fi
101 - fi
102 -
103 - if [ -x "${PREUPSCRIPT}" ] ; then
104 - "${PREUPSCRIPT}"
105 - fi
106 -
107 - start-stop-daemon --start \
108 - --make-pidfile \
109 - --pidfile "${VPNPID}" \
110 - --stderr "${VPNERRFILE}" \
111 - --stdout "${VPNLOGFILE}" \
112 - --background \
113 - --exec /usr/sbin/openconnect -- \
114 - --interface="${VPN}" \
115 - --pid-file="${VPNPID}" \
116 - ${tmp_VPNOPTS} \
117 - ${tmp_SERVER} <<-E
118 - ${tmp_PASSWORD}
119 - E
120 -
121 - local retval=$?
122 -
123 - if [ ! ${retval} -eq 0 ]; then
124 - eend ${retval}
125 - return ${retval}
126 - fi
127 -
128 - if [ -x "${POSTUPSCRIPT}" ] ; then
129 - # wait until the interface is up and an ip address is set before running postup
130 - while true; do
131 - if [ -n "$(ip addr show $VPN | grep inet)" ]; then
132 - "${POSTUPSCRIPT}"
133 - break
134 - fi
135 - done
136 - fi
137 -
138 - eend $?
139 -}
140 -
141 -stop() {
142 - ebegin "Stopping OpenConnect: ${VPN}"
143 -
144 - checkconfig || return 1
145 -
146 - if [ -x "${PREDOWNSCRIPT}" ] ; then
147 - "${PREDOWNSCRIPT}"
148 - fi
149 -
150 - start-stop-daemon --pidfile "${VPNPID}" --stop /usr/sbin/openconnect
151 - local retval=$?
152 -
153 - if [ ! ${retval} -eq 0 ]; then
154 - eend ${retval}
155 - return ${retval}
156 - fi
157 -
158 -
159 - if [ -x "${POSTDOWNSCRIPT}" ] ; then
160 - "${POSTDOWNSCRIPT}"
161 - fi
162 - eend $?
163 -}
164
165 diff --git a/net-misc/openconnect/files/openconnect.init.in-r3 b/net-misc/openconnect/files/openconnect.init.in-r3
166 deleted file mode 100644
167 index daaec8e..00000000
168 --- a/net-misc/openconnect/files/openconnect.init.in-r3
169 +++ /dev/null
170 @@ -1,145 +0,0 @@
171 -#!/sbin/openrc-run
172 -# Copyright 1999-2014 Gentoo Foundation
173 -# Distributed under the terms of the GNU General Public License v2
174 -# $Id$
175 -
176 -VPN="${RC_SVCNAME#*.}"
177 -VPNLOG="/var/log/openconnect/${VPN}"
178 -VPNLOGFILE="${VPNLOG}/openconnect.log"
179 -VPNERRFILE="${VPNLOG}/openconnect.err"
180 -VPNPID="/run/openconnect/${VPN}.pid"
181 -VPNDIR="/etc/openconnect/${VPN}"
182 -PREUPSCRIPT="${VPNDIR}/preup.sh"
183 -PREDOWNSCRIPT="${VPNDIR}/predown.sh"
184 -POSTUPSCRIPT="${VPNDIR}/postup.sh"
185 -POSTDOWNSCRIPT="${VPNDIR}/postdown.sh"
186 -SERVER="server_${VPN}"
187 -PASSWORD="password_${VPN}"
188 -VPNOPTS="vpnopts_${VPN}"
189 -
190 -depend() {
191 - before netmount
192 -}
193 -
194 -checkconfig() {
195 - if [ $VPN = "openconnect" ]; then
196 - eerror "You cannot call openconnect directly. You must create a symbolic link to it with the vpn name:"
197 - echo
198 - eerror "ln -s /etc/init.d/openconnect /etc/init.d/openconnect.vpn0"
199 - echo
200 - eerror "And then call it instead:"
201 - echo
202 - eerror "/etc/init.d/openconnect.vpn0 start"
203 - return 1
204 - fi
205 -}
206 -
207 -checktuntap() {
208 - if [ $(uname -s) = "Linux" ] ; then
209 - if [ ! -e /dev/net/tun ]; then
210 - if ! modprobe tun ; then
211 - eerror "TUN/TAP support is not available in this kernel"
212 - return 1
213 - fi
214 - fi
215 - if [ -h /dev/net/tun ] && [ -c /dev/misc/net/tun ]; then
216 - ebegin "Detected broken /dev/net/tun symlink, fixing..."
217 - rm -f /dev/net/tun
218 - ln -s /dev/misc/net/tun /dev/net/tun
219 - eend $?
220 - fi
221 - fi
222 -}
223 -
224 -start() {
225 - ebegin "Starting OpenConnect: ${VPN}"
226 -
227 - local tmp_SERVER tmp_VPNOPTS tmp_PASSWORD
228 - eval tmp_SERVER="\${${SERVER}}"
229 - eval tmp_VPNOPTS="\${${VPNOPTS}}"
230 - eval tmp_PASSWORD="\${${PASSWORD}}"
231 -
232 - checkconfig || return 1
233 -
234 - checktuntap || return 1
235 -
236 - if [ "${tmp_SERVER}" = "vpn.server.tld" ]; then
237 - eend 1 "${VPN} not configured"
238 - return 1
239 - fi
240 -
241 - if [ ! -e "${VPNLOG}" ]; then
242 - mkdir -p "${VPNLOG}"
243 - fi
244 -
245 - local piddir="${VPNPID%/*}"
246 - if [ ! -d "$piddir" ] ; then
247 - mkdir -p "$piddir"
248 - if [ $? -ne 0 ]; then
249 - eerror "Directory $piddir for pidfile does not exist and cannot be created"
250 - return 1
251 - fi
252 - fi
253 -
254 - if [ -x "${PREUPSCRIPT}" ] ; then
255 - "${PREUPSCRIPT}"
256 - fi
257 -
258 - start-stop-daemon --start \
259 - --make-pidfile \
260 - --pidfile "${VPNPID}" \
261 - --stderr "${VPNERRFILE}" \
262 - --stdout "${VPNLOGFILE}" \
263 - --background \
264 - --exec /usr/sbin/openconnect -- \
265 - --interface="${VPN}" \
266 - --pid-file="${VPNPID}" \
267 - ${tmp_VPNOPTS} \
268 - ${tmp_SERVER} <<-E
269 - ${tmp_PASSWORD}
270 - E
271 -
272 - local retval=$?
273 -
274 - if [ ! ${retval} -eq 0 ]; then
275 - eend ${retval}
276 - return ${retval}
277 - fi
278 -
279 - if [ -x "${POSTUPSCRIPT}" ] ; then
280 - # wait until the interface is up and an ip address is set before running postup
281 - while true; do
282 - sleep 0.5
283 - if [ -n "$(ip addr show $VPN 2> /dev/null | grep inet)" ]; then
284 - "${POSTUPSCRIPT}"
285 - break
286 - fi
287 - done
288 - fi
289 -
290 - eend $?
291 -}
292 -
293 -stop() {
294 - ebegin "Stopping OpenConnect: ${VPN}"
295 -
296 - checkconfig || return 1
297 -
298 - if [ -x "${PREDOWNSCRIPT}" ] ; then
299 - "${PREDOWNSCRIPT}"
300 - fi
301 -
302 - start-stop-daemon --pidfile "${VPNPID}" --stop /usr/sbin/openconnect
303 - local retval=$?
304 -
305 - if [ ! ${retval} -eq 0 ]; then
306 - eend ${retval}
307 - return ${retval}
308 - fi
309 -
310 -
311 - if [ -x "${POSTDOWNSCRIPT}" ] ; then
312 - "${POSTDOWNSCRIPT}"
313 - fi
314 - eend $?
315 -}