1#!/bin/sh -e 2 3# $NetBSD: vif-ip-nbsd,v 1.1.1.1 2008/08/07 20:26:57 cegger Exp $ 4# Called by xenbackendd 5# Usage: vif-ip xsdir_backend_path state 6 7DIR=$(dirname "$0") 8. "${DIR}/hotplugpath.sh" 9 10PATH=${bindir}:${sbindir}:${LIBEXEC_BIN}:/bin:/usr/bin:/sbin:/usr/sbin 11export PATH 12 13xpath=$1 14xstatus=$2 15 16case $xstatus in 176) 18 # device removed 19 xenstore-rm $xpath 20 exit 0 21 ;; 222) 23 xip=$(xenstore-read "$xpath/ip") 24 xfid=$(xenstore-read "$xpath/frontend-id") 25 xhandle=$(xenstore-read "$xpath/handle") 26 iface=$(xenstore-read "$xpath/vifname") 27 ifconfig $iface $xip up 28 xenstore-write $xpath/hotplug-status connected 29 exit 0 30 ;; 31*) 32 exit 0 33 ;; 34esac 35