source: MondoRescue/trunk/mindi-busybox/examples/zcip.script@ 929

Last change on this file since 929 was 821, checked in by Bruno Cornec, 18 years ago

Addition of busybox 1.2.1 as a mindi-busybox new package
This should avoid delivering binary files in mindi not built there (Fedora and Debian are quite serious about that)

File size: 691 bytes
Line 
1#!/bin/sh
2
3# only for use as a "zcip" callback script
4if [ "x$interface" = x ]
5then
6 exit 1
7fi
8
9# zcip should start on boot/resume and various media changes
10case "$1" in
11init)
12 # for now, zcip requires the link to be already up,
13 # and it drops links when they go down. that isn't
14 # the most robust model...
15 exit 0
16 ;;
17config)
18 if [ "x$ip" = x ]
19 then
20 exit 1
21 fi
22 # remember $ip for $interface, to use on restart
23 if [ "x$IP" != x -a -w "$IP.$interface" ]
24 then
25 echo $ip > "$IP.$interface"
26 fi
27 exec ip address add dev $interface \
28 scope link local "$ip/16" broadcast +
29 ;;
30deconfig)
31 if [ x$ip = x ]
32 then
33 exit 1
34 fi
35 exec ip address del dev $interface local $ip
36 ;;
37esac
38exit 1
Note: See TracBrowser for help on using the repository browser.