File: atmarp

package info (click to toggle)
ifupdown-scripts-zg2 0.2-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 484 kB
  • ctags: 55
  • sloc: sh: 4,037; makefile: 37
file content (40 lines) | stat: -rwxr-xr-x 1,020 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# $Header: /var/local/cvs/debian/ifupdown-scripts-zg2/scripts/ifupdown-scripts-zg2.d/atmarp,v 1.1 2004/09/12 18:00:04 mh Exp $

# IFACE      = Logical interface name
# MODE       = { start | stop }
# METHOD     = manual, otherwise exit
# IF_ATMARPn = ATM arp information (IP ATMVCI)

. /etc/network/ifupdown-scripts-zg2.d/common-functions

# only do something for ATM interfaces

[ "$IF_TYPE" == "atm" ] || exit 0

# only do something if interface is being started

case "$MODE" in
  start)
    # iterate through all ATMARP entries and load their contents into atmarpd
    for R in `set | awk 'BEGIN { FS="=";} /^IF_ATMARP/ { print $1; }'`; do
      eval S=\$$R

      IP="${S%% *}"
      S="${S#* }"
      ATM="${S%% *}"
      QOS=""
      if [ "$ATM" != "$S" ]; then
      	QOS="qos ${S##* }"
      fi
      ATM="${ATM//\//.}"
      verbose "atmarp -s $IP $ATM $QOS"
      atmarp -s $IP $ATM $QOS
      add_down "atmarp" "-d $IP"
    done
    ;;
  stop)
    exec_down "atmarp" "atmarp"
esac

# end of file