Annotation of /trunk/magellan-initscripts/rc/network
Parent Directory | Revision Log
Revision 1090 -
(hide annotations)
(download)
Wed Jul 14 07:25:22 2010 UTC (14 years, 2 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/network
File size: 11753 byte(s)
Wed Jul 14 07:25:22 2010 UTC (14 years, 2 months ago) by niro
Original Path: trunk/magellan-initscripts/etc/rc.d/init.d/network
File size: 11753 byte(s)
-resolv.conf: head/tail support
1 | niro | 2 | #!/bin/bash |
2 | niro | 931 | # $Id$ |
3 | niro | 2 | |
4 | #%rlevels: 0:k 1:k 2:k 3:s 4:s 5:s 6:k | ||
5 | #%start: 20 | ||
6 | #%stop: 80 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | niro | 781 | source /etc/conf.d/rc |
14 | niro | 20 | source ${rc_functions} |
15 | niro | 2 | |
16 | niro | 243 | # read values from files |
17 | read_value() | ||
18 | { | ||
19 | local var="$1" | ||
20 | local file="$2" | ||
21 | local value | ||
22 | |||
23 | # local all possible vars | ||
24 | # global | ||
25 | local ONBOOT | ||
26 | local NETWORKING | ||
27 | niro | 691 | |
28 | niro | 243 | # static |
29 | local IP | ||
30 | local NETMASK | ||
31 | local BROADCAST | ||
32 | local NETWORKING | ||
33 | local FORCE_MAC_TO | ||
34 | |||
35 | # dhcp | ||
36 | local DHCP_PROG | ||
37 | local DHCP_START | ||
38 | local DHCP_STOP | ||
39 | |||
40 | # default gw | ||
41 | local GATEWAY | ||
42 | local GATEWAY_IF | ||
43 | |||
44 | # wireless extensions | ||
45 | local WIRELESS_AP | ||
46 | local WIRELESS_AUTH_MODE | ||
47 | local WIRELESS_BITRATE | ||
48 | local WIRELESS_CHANNEL | ||
49 | local WIRELESS_DEFAULT_KEY | ||
50 | local WIRELESS_ESSID | ||
51 | local WIRELESS_FREQUENCY | ||
52 | local WIRELESS_KEY | ||
53 | local WIRELESS_KEY_ASCII | ||
54 | local WIRELESS_KEY_0 | ||
55 | local WIRELESS_KEY_1 | ||
56 | local WIRELESS_KEY_2 | ||
57 | local WIRELESS_KEY_3 | ||
58 | local WIRELESS_KEY_LENGTH | ||
59 | local WIRELESS_MODE | ||
60 | local WIRELESS_NICK | ||
61 | local WIRELESS_NWID | ||
62 | local WIRELESS_POWER | ||
63 | niro | 636 | local WIRELESS_WPA_DRIVER |
64 | niro | 243 | |
65 | niro | 636 | local BRIDGE_INTERFACES |
66 | local BRIDGE_STP | ||
67 | |||
68 | niro | 243 | source ${file} |
69 | eval value=\$$(echo ${var}) | ||
70 | echo "${value}" | ||
71 | } | ||
72 | |||
73 | checkconfig() | ||
74 | { | ||
75 | niro | 636 | if [[ -z ${NETWORKING} ]] |
76 | niro | 2 | then |
77 | echo "NETWORKING missing in net.${interface}, aborted" | ||
78 | exit 1 | ||
79 | fi | ||
80 | |||
81 | niro | 20 | case "${NETWORKING}" in |
82 | niro | 2 | static) |
83 | niro | 636 | if [[ -z ${IP} ]] |
84 | niro | 2 | then |
85 | echo "IP missing in net.${interface}, aborted" | ||
86 | exit 1 | ||
87 | fi | ||
88 | |||
89 | niro | 636 | if [[ -z ${NETMASK} ]] |
90 | niro | 2 | then |
91 | echo -n "NETMASK missing in net.${interface}, " | ||
92 | echo "using 255.255.255.0" | ||
93 | NETMASK=255.255.255.0 | ||
94 | fi | ||
95 | |||
96 | niro | 636 | if [[ -z ${BROADCAST} ]] |
97 | niro | 2 | then |
98 | echo -n "BROADCAST missing in net.${interface}, " | ||
99 | echo "using default address" | ||
100 | fi | ||
101 | ;; | ||
102 | niro | 20 | |
103 | niro | 2 | dhcp) |
104 | niro | 636 | if [[ -z ${DHCP_PROG} ]] |
105 | niro | 2 | then |
106 | niro | 955 | echo -n "DHCP_PROG missing in net.${interface}," |
107 | echo "using default programm" | ||
108 | DHCP_PROG="/sbin/dhcpcd" | ||
109 | niro | 2 | fi |
110 | niro | 955 | [[ -z ${DHCP_START} ]] && DHCP_START="-t 10" |
111 | [[ -z ${DHCP_STOP} ]] && DHCP_STOP="-k" | ||
112 | niro | 2 | ;; |
113 | niro | 20 | |
114 | niro | 2 | esac |
115 | } | ||
116 | |||
117 | niro | 243 | # onboot_interface_list /path/to/files* |
118 | onboot_interface_list() | ||
119 | { | ||
120 | local file | ||
121 | local devices | ||
122 | local iface | ||
123 | niro | 2 | |
124 | niro | 243 | # get list of all devices |
125 | for file in $@ | ||
126 | do | ||
127 | if [[ $(read_value ONBOOT ${file}) = yes ]] | ||
128 | then | ||
129 | iface="$(basename ${file} | sed s/net.//)" | ||
130 | niro | 506 | # exclude backup files and exclude net.routes too |
131 | niro | 243 | case "${iface}" in |
132 | niro | 2 | *~) ;; |
133 | niro | 506 | */net.routes) ;; |
134 | niro | 243 | *) devices="${devices} $(basename ${file} | sed s/net.//)" ;; |
135 | esac | ||
136 | fi | ||
137 | done | ||
138 | niro | 181 | |
139 | niro | 243 | echo "${devices}" |
140 | } | ||
141 | niro | 181 | |
142 | niro | 268 | config_wireless_wep() |
143 | { | ||
144 | local iface="$1" | ||
145 | |||
146 | if [[ -z ${iface} ]] | ||
147 | then | ||
148 | echo "WEP: no \$iface given. Aborting setup." | ||
149 | return 1 | ||
150 | fi | ||
151 | |||
152 | niro | 270 | ${CURS_UP} |
153 | ${SET_WWCOL} | ||
154 | echo "[AUTH: WEP]" | ||
155 | |||
156 | niro | 268 | iwconfig "${iface}" enc on |
157 | [[ -n ${WIRELESS_KEY_LENGTH} ]] && iwconfig "${iface}" enc "${WIRELESS_KEY_LENGTH}" | ||
158 | [[ -n ${WIRELESS_KEY} ]] && iwconfig "${iface}" key "${WIRELESS_KEY}" | ||
159 | [[ -n ${WIRELESS_KEY_ASCII} ]] && iwconfig "${iface}" key s:"${WIRELESS_KEY_ASCII}" | ||
160 | } | ||
161 | |||
162 | config_wireless_wpa() | ||
163 | { | ||
164 | local iface="$1" | ||
165 | |||
166 | if [[ -z ${iface} ]] | ||
167 | then | ||
168 | echo "WPA: no \$iface given. Aborting setup." | ||
169 | return 1 | ||
170 | fi | ||
171 | |||
172 | if [ ! -x /sbin/wpa_supplicant ] | ||
173 | then | ||
174 | echo "WPA: wpa_supplicant not installed. Aborting setup." | ||
175 | return 1 | ||
176 | fi | ||
177 | |||
178 | niro | 270 | ${CURS_UP} |
179 | ${SET_WWCOL} | ||
180 | echo "[AUTH: WPA]" | ||
181 | |||
182 | niro | 268 | # get default settings |
183 | [[ -f /etc/conf.d/wpa_supplicant ]] && source /etc/conf.d/wpa_supplicant | ||
184 | |||
185 | # check the configuration | ||
186 | [[ -z ${WIRELESS_WPA_CONFIG} ]] && WIRELESS_WPA_CONFIG=/etc/wpa_supplicant.auto | ||
187 | [[ -z ${WIRELESS_WPA_SKEL} ]] && WIRELESS_WPA_SKEL=/etc/conf.d/wpa_supplicant.skel | ||
188 | |||
189 | niro | 872 | # use wext as default driver, do not abort here anymore |
190 | [[ -z ${WIRELESS_WPA_DRIVER} ]] && WIRELESS_WPA_DRIVER=wext | ||
191 | |||
192 | niro | 268 | # write a config with the settings from net.${iface} |
193 | # only wpa-psk ! all other needs manual setup | ||
194 | if [[ ${WIRELESS_WPA_AUTOCONF} = true ]] | ||
195 | then | ||
196 | # write default cfg from skeleton | ||
197 | cat ${WIRELESS_WPA_SKEL} > ${WIRELESS_WPA_CONFIG} | ||
198 | |||
199 | niro | 867 | local wpa_proto |
200 | case ${WIRELESS_AUTH_MODE} in | ||
201 | wpa) wpa_proto="WPA" ;; | ||
202 | wpa2) wpa_proto="WPA2" ;; | ||
203 | esac | ||
204 | |||
205 | niro | 268 | # setup the network entry |
206 | sed -i -e "s:@WIRELESS_ESSID@:${WIRELESS_ESSID}:g" \ | ||
207 | niro | 867 | -e "s:@WIRELESS_KEY@:${WIRELESS_KEY_ASCII}:g" \ |
208 | -e "s:@WIRELESS_AUTH_MODE@:${wpa_proto}:g" \ | ||
209 | niro | 268 | ${WIRELESS_WPA_CONFIG} |
210 | fi | ||
211 | |||
212 | niro | 275 | # remove old state dir |
213 | [ -d /var/run/wpa_supplicant ] && rm -rf /var/run/wpa_supplicant | ||
214 | |||
215 | niro | 268 | # now run the wpa_supplicant dameon |
216 | wpa_supplicant -B \ | ||
217 | -D"${WIRELESS_WPA_DRIVER}" \ | ||
218 | -c"${WIRELESS_WPA_CONFIG}" \ | ||
219 | -i"${iface}" \ | ||
220 | ${WIRELESS_WPA_OPTS} | ||
221 | niro | 270 | |
222 | # echo wait 5 seconds | ||
223 | echo " Waiting 5 seconds to retrieve authentification reply ... " | ||
224 | sleep 5 | ||
225 | niro | 268 | } |
226 | |||
227 | setup_wireless_extensions() | ||
228 | { | ||
229 | local iface="$1" | ||
230 | |||
231 | if [[ -z ${iface} ]] | ||
232 | then | ||
233 | echo "WIRELESS_EXTENSIONS: no \$iface given. Aborting setup." | ||
234 | return 1 | ||
235 | fi | ||
236 | |||
237 | niro | 275 | if [[ -n ${WIRELESS_BITRATE} ]] || |
238 | [[ -n ${WIRELESS_CHANNEL} ]] || | ||
239 | [[ -n ${WIRELESS_ESSID} ]] || | ||
240 | [[ -n ${WIRELESS_FREQUENCY} ]] || | ||
241 | [[ -n ${WIRELESS_MODE} ]] || | ||
242 | [[ -n ${WIRELESS_NICK} ]] || | ||
243 | [[ -n ${WIRELESS_AUTH_MODE} ]] | ||
244 | then | ||
245 | echo -e ${COLOREDSTAR}"Setting up wlan-ext for ${COLBLUE}${iface}${COLDEFAULT} ... " | ||
246 | fi | ||
247 | niro | 270 | |
248 | niro | 268 | [[ -n ${WIRELESS_BITRATE} ]] && iwconfig "${iface}" rate "${WIRELESS_BITRATE}" |
249 | [[ -n ${WIRELESS_CHANNEL} ]] && iwconfig "${iface}" channel "${WIRELESS_CHANNEL}" | ||
250 | [[ -n ${WIRELESS_ESSID} ]] && iwconfig "${iface}" essid "${WIRELESS_ESSID}" | ||
251 | [[ -n ${WIRELESS_FREQUENCY} ]] && iwconfig "${iface}" freq "${WIRELESS_FREQUENCY}" | ||
252 | [[ -n ${WIRELESS_MODE} ]] && iwconfig "${iface}" mode "${WIRELESS_MODE}" | ||
253 | [[ -n ${WIRELESS_NICK} ]] && iwconfig "${iface}" nick "${WIRELESS_NICK}" | ||
254 | |||
255 | case "${WIRELESS_AUTH_MODE}" in | ||
256 | niro | 867 | wpa|wpa2) config_wireless_wpa "${iface}" ;; |
257 | wep|on) config_wireless_wep "${iface}" ;; | ||
258 | off) iwconfig "${iface}" enc off ;; | ||
259 | niro | 268 | esac |
260 | } | ||
261 | |||
262 | niro | 506 | config_bridge_devices() |
263 | { | ||
264 | local iface="$1" | ||
265 | local method="$2" | ||
266 | niro | 636 | local bport |
267 | niro | 506 | |
268 | if [[ -z ${iface} ]] | ||
269 | then | ||
270 | echo "BRIDGE: no \$iface given. Aborting setup." | ||
271 | return 1 | ||
272 | fi | ||
273 | |||
274 | if [[ -z ${method} ]] | ||
275 | then | ||
276 | echo "BRIDGE: no \$method given. Aborting setup." | ||
277 | return 1 | ||
278 | fi | ||
279 | |||
280 | # first check for brctl | ||
281 | if [[ -z $(which brctl) ]] | ||
282 | then | ||
283 | echo "brctl not found! Please install 'net-misc/bridge-utils'." | ||
284 | return 1 | ||
285 | fi | ||
286 | |||
287 | # check the config | ||
288 | niro | 638 | if [[ -z ${BRIDGE_INTERFACES} ]] |
289 | niro | 506 | then |
290 | niro | 638 | echo "BRIDGE: no \$BRIDGE_INTERFACES given. Aborting setup." |
291 | niro | 506 | return 1 |
292 | fi | ||
293 | |||
294 | case ${method} in | ||
295 | add) | ||
296 | # setup the bridge device | ||
297 | brctl addbr ${iface} | ||
298 | niro | 636 | for bport in ${BRIDGE_INTERFACES} |
299 | do | ||
300 | # enter promiscous mode | ||
301 | ifconfig ${bport} 0.0.0.0 promisc | ||
302 | # now setup the bridge | ||
303 | brctl addif ${iface} ${bport} | ||
304 | done | ||
305 | # enable spanning-tree protocol | ||
306 | niro | 640 | case ${BRIDGE_STP} in |
307 | niro | 636 | on|off) brctl stp ${iface} ${BRIDGE_STP} ;; |
308 | *) echo "BRIDGE: unkown value \$BRIDGE_STP='$BRIDGE_STP'."; return 1 ;; | ||
309 | esac | ||
310 | niro | 506 | ;; |
311 | niro | 636 | |
312 | niro | 506 | remove) |
313 | niro | 636 | for bport in ${BRIDGE_INTERFACE} |
314 | do | ||
315 | # bring the interface down | ||
316 | ifconfig ${bport} down | ||
317 | # remove the interface from the bridge | ||
318 | brctl delif ${iface} ${bport} | ||
319 | done | ||
320 | niro | 506 | # bring the bridge down |
321 | brctl delbr ${iface} | ||
322 | ;; | ||
323 | esac | ||
324 | niro | 636 | |
325 | niro | 506 | # unset the bridge variable to be safe |
326 | niro | 636 | unset BRIDGE_INTERFACES |
327 | niro | 506 | # continue to setup generic networking |
328 | } | ||
329 | |||
330 | config_routes() | ||
331 | { | ||
332 | local method="$1" | ||
333 | local message | ||
334 | |||
335 | # only add and del are allowed | ||
336 | case ${method} in | ||
337 | add) message="Adding route ${COLBLUE}${route}${COLDEFAULT} ..." ;; | ||
338 | del) message="Removing route ${COLBLUE}${route}${COLDEFAULT} ..." ;; | ||
339 | *) | ||
340 | echo "config_routes: unsupported \$method '${method}'." | ||
341 | exit 1 | ||
342 | ;; | ||
343 | esac | ||
344 | |||
345 | # adds/delete user routes | ||
346 | if [[ -f /etc/conf.d/net.routes ]] | ||
347 | then | ||
348 | ( cat /etc/conf.d/net.routes; echo ) | # make sure there is a LF at the end | ||
349 | while read route | ||
350 | do | ||
351 | case "${route}" in | ||
352 | \#*|"") continue ;; | ||
353 | esac | ||
354 | echo -e ${COLOREDSTAR}"${message}" | ||
355 | route ${method} ${route} | ||
356 | evaluate_retval | ||
357 | done | ||
358 | fi | ||
359 | } | ||
360 | |||
361 | niro | 243 | networking_start() |
362 | { | ||
363 | niro | 522 | local iface dns routes ALL_INTERFACES |
364 | niro | 243 | |
365 | niro | 522 | if [[ -z $1 ]] |
366 | then | ||
367 | ALL_INTERFACES=$(onboot_interface_list ${network_settings}/net.*) | ||
368 | else | ||
369 | if [[ -e ${network_settings}/net.$1 ]] | ||
370 | then | ||
371 | ALL_INTERFACES="$1" | ||
372 | else | ||
373 | ${FAILURE} | ||
374 | echo "Interface $1 does not exist. Aborting" | ||
375 | ${NORMAL} | ||
376 | exit 1 | ||
377 | fi | ||
378 | fi | ||
379 | |||
380 | niro | 243 | # get list of all devices |
381 | niro | 522 | for iface in ${ALL_INTERFACES} |
382 | niro | 243 | do |
383 | # checkconfig | ||
384 | source ${network_settings}/net.${iface} || exit 1 | ||
385 | checkconfig | ||
386 | |||
387 | niro | 270 | # setup mac |
388 | niro | 955 | if [[ -n ${FORCE_MAC_TO} ]] |
389 | niro | 270 | then |
390 | echo -e ${COLOREDSTAR}"Faking MAC to ${FORCE_MAC_TO} for ${COLBLUE}${iface}${COLDEFAULT} ... " | ||
391 | ifconfig "${iface}" hw ether "${FORCE_MAC_TO}" | ||
392 | evaluate_retval | ||
393 | fi | ||
394 | |||
395 | niro | 506 | # setup bridges |
396 | if [[ ${iface} = br[0-9]* ]] | ||
397 | then | ||
398 | config_bridge_devices ${iface} add | ||
399 | fi | ||
400 | |||
401 | niro | 270 | # now configure wireless_extensions |
402 | [ -x /usr/sbin/iwconfig ] && setup_wireless_extensions "${iface}" | ||
403 | |||
404 | niro | 243 | echo -e ${COLOREDSTAR}"Bringing up interface ${COLBLUE}${iface}${COLDEFAULT} ..." |
405 | |||
406 | niro | 868 | # activate the interface |
407 | ifconfig "${iface}" up | ||
408 | |||
409 | niro | 243 | # setup static or dhcp |
410 | case ${NETWORKING} in | ||
411 | dhcp|DHCP) | ||
412 | ${CURS_UP} | ||
413 | ${SET_WWCOL} | ||
414 | echo "[DHCP]" | ||
415 | niro | 955 | loadproc "${DHCP_PROG}" "${DHCP_START}" "${iface}" |
416 | niro | 2 | ;; |
417 | niro | 243 | static|STATIC) |
418 | ${CURS_UP} | ||
419 | ${SET_WWCOL} | ||
420 | echo "[STATIC]" | ||
421 | ifconfig "${iface}" "${IP}" netmask "${NETMASK}" broadcast "${BROADCAST}" | ||
422 | evaluate_retval | ||
423 | ;; | ||
424 | esac | ||
425 | niro | 2 | |
426 | niro | 243 | # setup def gw |
427 | if [[ -n ${GATEWAY} ]] | ||
428 | niro | 2 | then |
429 | niro | 245 | echo -e ${COLOREDSTAR}"Setting up default gateway for ${COLBLUE}${iface}${COLDEFAULT} ..." |
430 | niro | 243 | route add default gateway ${GATEWAY} metric 1 dev ${iface} |
431 | niro | 2 | evaluate_retval |
432 | niro | 684 | |
433 | unset GATEWAY | ||
434 | niro | 2 | fi |
435 | |||
436 | niro | 245 | # setup /etc/resolv.conf |
437 | niro | 1090 | # whipe out the old one |
438 | echo "# Generated by the magellan-initscripts for ${iface}" > /etc/resolv.conf | ||
439 | # include head | ||
440 | if [ -f /etc/resolv.conf.head ] | ||
441 | then | ||
442 | cat /etc/resolv.conf.head >> /etc/resolv.conf | ||
443 | else | ||
444 | echo "# /etc/resolv.conf.head can replace this line" >> /etc/resolv.conf | ||
445 | fi | ||
446 | # add given nameserver | ||
447 | niro | 245 | if [[ -n ${NAMESERVER} ]] |
448 | then | ||
449 | echo -e ${COLOREDSTAR}"Setting up all nameserver for ${COLBLUE}${iface}${COLDEFAULT} ..." | ||
450 | niro | 1090 | |
451 | niro | 245 | for dns in ${NAMESERVER} |
452 | do | ||
453 | echo "nameserver ${dns}" >> /etc/resolv.conf | ||
454 | done | ||
455 | niro | 684 | |
456 | unset NAMESERVER | ||
457 | niro | 245 | fi |
458 | niro | 1090 | # include tail |
459 | if [ -f /etc/resolv.conf.tail ] | ||
460 | then | ||
461 | cat /etc/resolv.conf.tail >> /etc/resolv.conf | ||
462 | else | ||
463 | echo "# /etc/resolv.conf.tail can replace this line" >> /etc/resolv.conf | ||
464 | fi | ||
465 | niro | 243 | done |
466 | niro | 506 | |
467 | # setup user routes | ||
468 | config_routes add | ||
469 | niro | 243 | } |
470 | niro | 2 | |
471 | niro | 243 | networking_stop() |
472 | { | ||
473 | niro | 522 | if [[ -z $1 ]] |
474 | then | ||
475 | ALL_INTERFACES=$(onboot_interface_list ${network_settings}/net.*) | ||
476 | else | ||
477 | if [[ -e ${network_settings}/net.$1 ]] | ||
478 | then | ||
479 | ALL_INTERFACES="$1" | ||
480 | else | ||
481 | ${FAILURE} | ||
482 | echo "Interface $1 does not exist. Aborting" | ||
483 | ${NORMAL} | ||
484 | exit 1 | ||
485 | fi | ||
486 | fi | ||
487 | |||
488 | niro | 243 | # get list of all devices |
489 | niro | 522 | for iface in ${ALL_INTERFACES} |
490 | niro | 243 | do |
491 | source ${network_settings}/net.${iface} || exit 1 | ||
492 | checkconfig | ||
493 | |||
494 | if [[ -n ${GATEWAY} ]] | ||
495 | niro | 2 | then |
496 | echo -e ${COLOREDSTAR}"Removing default gateway ..." | ||
497 | route del -net default | ||
498 | evaluate_retval | ||
499 | fi | ||
500 | |||
501 | niro | 243 | echo -e ${COLOREDSTAR}"Bringing down interface ${COLBLUE}${iface}${COLDEFAULT} ..." |
502 | ifconfig ${iface} down | ||
503 | evaluate_retval | ||
504 | niro | 2 | |
505 | niro | 506 | # remove bridges |
506 | if [[ ${iface} = br[0-9]* ]] | ||
507 | then | ||
508 | config_bridge_devices ${iface} remove | ||
509 | fi | ||
510 | |||
511 | niro | 243 | # shutdown dhcp-daemon |
512 | if [[ ${NETWORKING} = dhcp ]] && [[ -n $(pidof ${DHCP_PROG}) ]] | ||
513 | then | ||
514 | echo -e ${COLOREDSTAR}"Stopping the dhcp-daemon ..." | ||
515 | ${CURS_UP} | ||
516 | ${SET_WWCOL} | ||
517 | echo "[$(basename ${DHCP_PROG})]" | ||
518 | niro | 270 | ${DHCP_PROG} ${DHCP_STOP} "${iface}" |
519 | niro | 243 | evaluate_retval |
520 | fi | ||
521 | niro | 268 | |
522 | # shutdown wpa_supplicant daemon | ||
523 | if [[ -n $(pidof wpa_supplicant) ]] | ||
524 | then | ||
525 | killall wpa_supplicant | ||
526 | fi | ||
527 | niro | 243 | done |
528 | niro | 275 | |
529 | niro | 270 | # remove state dir |
530 | if [ -d /var/run/wpa_supplicant ] | ||
531 | then | ||
532 | rm -rf /var/run/wpa_supplicant | ||
533 | fi | ||
534 | niro | 506 | |
535 | # delete user routes | ||
536 | config_routes del | ||
537 | niro | 243 | } |
538 | niro | 2 | |
539 | niro | 243 | case $1 in |
540 | start) | ||
541 | niro | 522 | networking_start $2 |
542 | niro | 2 | update_svcstatus $1 |
543 | niro | 243 | splash svc_started "$(basename $0)" 0 |
544 | ;; | ||
545 | |||
546 | stop) | ||
547 | niro | 522 | networking_stop $2 |
548 | niro | 243 | update_svcstatus $1 |
549 | niro | 2 | splash svc_stopped "$(basename $0)" 0 |
550 | ;; | ||
551 | |||
552 | restart) | ||
553 | $0 stop | ||
554 | sleep 1 | ||
555 | $0 start | ||
556 | ;; | ||
557 | |||
558 | *) | ||
559 | niro | 522 | echo "Usage: $0 {start|stop|restart} [interface]" |
560 | niro | 2 | exit 1 |
561 | ;; | ||
562 | esac |
Properties
Name | Value |
---|---|
svn:executable | * |