1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../iproute2/rocknet_iproute2.sh
5 # Copyright (C) 2004 - 2006 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; version 2 of the License. A copy of the
12 # GNU General Public License can be found in the file COPYING.
13 # --- T2-COPYRIGHT-NOTE-END ---
16 if isfirst
"iproute2_$if"; then
17 addcode up
5 4 "ip link set $if up"
18 addcode down
5 4 "ip link set $if down"
19 addcode down
5 5 "ip addr flush dev $if"
25 # common config error sanity check
27 echo "WARNING: IP has no CIDR network prefix (e.g. /24)!"
28 addcode up
5 5 "ip addr add $1 broadcast + dev $if"
33 code
="ip route append default via $1 dev $if" ; shift
37 code
="$code metric $2" ; shift ;;
41 addcode up
6 5 "$code"
46 code
="ip route append $1 via $2 dev $if" ; shift ; shift
50 code
="$code metric $2" ; shift ;;
54 addcode up
6 5 "$code"
59 addcode up
4 3 "ip link set $if address $1"