File: atmarp

package info (click to toggle)
ifupdown-scripts-zg2 0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 500 kB
  • ctags: 76
  • sloc: sh: 3,606; makefile: 35
file content (40 lines) | stat: -rwxr-xr-x 915 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$

# 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 | sed -n '/^IF_SCRUP[^=]*=/{s/^\(^IF_ATMARP[^=]*\)=.*/\1/;p;}'); 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