File: atm-interfacename

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 (56 lines) | stat: -rwxr-xr-x 1,443 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# $Header: /var/local/cvs/debian/ifupdown-scripts-zg2/scripts/ifupdown-scripts-zg2.d/atm-interfacename,v 1.1 2004/09/12 18:00:04 mh Exp $

# IFACE      = Logical interface name
# MODE       = { start | stop }
# METHOD     = manual, otherwise exit
# IF_DEVICE  = physical interface name

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

# only do something for ATM interfaces

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

# remove state if interface is being stopped

if [ "$MODE" == "stop" ]; then
  exec_down "dev" ""
  exit 0
fi

case "$MODE" in
  start)

    # ATM interfaces can't be deleted (2003-09, atm-tools 2.4.1).

    if ! /sbin/ip link show dev $IF_DEVICE >/dev/null 2>&1; then
      # ATM interface $IF_DEVICE does not exist yet. Create.
      verbose "atmarp -c $IF_DEVICE"
      atmarp -c $IF_DEVICE
    fi

    add_down "dev" "$IF_DEVICE"

    # set physical interface name to what we want to have
    # atmarpd currently (atm-tools 2.4.1) doesn't work with that.

    #if [ "$iface" != "$IF_DEVICE" ]; then
      # we need to rename the iface
    #  ip link set dev $iface down
    #  ip link set dev $iface name $IF_DEVICE
    #else
      # iface already has the correct name, we're done
    #fi
    
    # don't take link up here because atmarpd barfs if link is taken
    # up before IP address is assigned (atm-tools 2.4.1)
    #cmd "ip link set dev $IF_DEVICE up"
    
    ;;
  stop)
    ;;
esac

# end of file