source: freewrt/package/fwifupdown/files/ifupdown.sh@ f8c14cc

Last change on this file since f8c14cc was 4624b5d, checked in by Christian Fischer <spaetzle@…>, 19 years ago

Added package fwifupdown, added busybox ifupdown patch

git-svn-id: svn://www.freewrt.org/trunk/freewrt@2373 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100755
File size: 971 bytes
Line 
1#!/bin/sh
2#
3# This file is part of the FreeWRT project. FreeWRT is copyrighted
4# material, please see the LICENCE file in the top-level directory
5# or at http://www.freewrt.org/licence for details.
6#
7# Christian Fischer <spaetzle@freewrt.org>
8#
9
10case $(basename $0) in
11 ifup)
12 ;;
13 ifdown)
14 ;;
15 *)
16 echo "Usage: ifup|ifdown [options]"
17 echo "For options see man busybox"
18 exit 1
19 ;;
20esac
21
22if [ -f /etc/conf.d/ifupdown ]
23then
24 . /etc/conf.d/ifupdown
25else
26 CFG_BUSYBOX_COMPAT=1
27fi
28
29
30if [ "$CFG_BUSYBOX_COMPAT" = "1" ]
31then
32 busybox $(basename $0) $@
33else
34 # cleanup hook dirs, or should we patch busybox ???
35 for dir in pre-up up down post-down
36 do
37 mount --bind /opt/ifupdown/hook /etc/network/if-${dir}.d
38 done
39
40 eval IFUPDOWN_ENV="" $(cat /etc/conf.d/ifupdown | sed "s/#.*//g" ) \
41 busybox $(basename $0) $@ 2>&1 | sed '/^run-parts:/d'
42
43 # restore hook dirs
44 for dir in pre-up up down post-down
45 do
46 umount /etc/network/if-${dir}.d
47 done
48fi
49
50# vim:ts=4
Note: See TracBrowser for help on using the repository browser.