From ad8071f582a354924e96a3842e4fda7895bb5b7f Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 30 Apr 2005 03:49:37 +0000 Subject: David Brownell submitted a new applet, zcip, based on RFC 3927. This is version 0418b. It compiled. --- examples/zcip.script | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 examples/zcip.script (limited to 'examples') diff --git a/examples/zcip.script b/examples/zcip.script new file mode 100644 index 000000000..988e542a4 --- /dev/null +++ b/examples/zcip.script @@ -0,0 +1,38 @@ +#!/bin/sh + +# only for use as a "zcip" callback script +if [ "x$interface" = x ] +then + exit 1 +fi + +# zcip should start on boot/resume and various media changes +case "$1" in +init) + # for now, zcip requires the link to be already up, + # and it drops links when they go down. that isn't + # the most robust model... + exit 0 + ;; +config) + if [ "x$ip" = x ] + then + exit 1 + fi + # remember $ip for $interface, to use on restart + if [ "x$IP" != x -a -w "$IP.$interface" ] + then + echo $ip > "$IP.$interface" + fi + exec ip address add dev $interface \ + scope link local "$ip/16" broadcast + + ;; +deconfig) + if [ x$ip = x ] + then + exit 1 + fi + exec ip address del dev $interface local $ip + ;; +esac +exit 1 -- cgit v1.2.3