PageRenderTime 176ms CodeModel.GetById 173ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/network/if-down.d/ifupdown-scripts-zg2-90lo-linkup

http://github.com/brinkman83/bashrc
#! | 33 lines | 22 code | 11 blank | 0 comment | 0 complexity | 760f55585c6f93c440a669cd8b135d71 MD5 | raw file
 1#!/bin/bash
 2# $Header$
 3
 4# Environment:
 5#  IFACE      = Logical interface name
 6#  MODE       = { start | stop }
 7#  METHOD     = manual, otherwise exit
 8#  ADDRFAM    = inet, otherwise exit
 9
10. /etc/network/ifupdown-scripts-zg2.d/common-functions
11
12# remove state if interface is being stopped
13
14if [ "$MODE" = "stop" ]; then
15  exec_down "mac" ""
16  exec_down "dev" ""
17  exit 0
18fi
19
20# only do something for loopback interfaces
21
22[ "$IF_TYPE" = "loopback" ] || exit 0
23
24# only do something if interface is being started
25
26[ "$MODE" = "start" ] || exit 0
27
28# save state
29
30add_down "dev" "$IF_DEVICE"
31cmd "ip link set dev $IF_DEVICE up"
32
33# vi:sw=2