#!/bin/sh #---------------------------------------------------------------------------- # /etc/rc.d/rc990.ipv6 # # Last Update: $Id$ #---------------------------------------------------------------------------- emit_ipv6_up_event() { log_info "Emitting ipv6-up event for dev=$emit_ipv6_event_dev prefix=$emit_ipv6_prefix..." run-ipv6-updown.sh up $emit_ipv6_event_dev $emit_ipv6_prefix log_info "...done" } #---------------------------------------------------------------------------- # added hooks for emitting ipv6-up and ipv6-down events if necessary #---------------------------------------------------------------------------- if [ "$ipv6_up_events" = "no" ] then regexp='^default\>.*\[[:space:]]*\([^[:space:]]\+\).*' emit_ipv6_event_dev=$(ip -6 route show | grep "$regexp" | sed -e "s/$regexp/\1/") if [ -n "$emit_ipv6_event_dev" ] then local=$(ip -6 addr show dev $emit_ipv6_event_dev | sed -n "s/^.*\[[:space:]]\+\([^ ]\+\).*/\1/p" | head -n 1) if [ -n "$local" ] then begin_script BASE "registering ipv6-up and ipv6-down event hooks" local=$(expandv6.sh "$local") emit_ipv6_prefix=$(prefixcalc6 "$local") post_boot_hooks="$post_boot_hooks emit_ipv6_up_event" cat <<-EOF >/var/run/emit-ipv6-down-event colecho "Emitting ipv6-down event for dev=$emit_ipv6_event_dev prefix=$emit_ipv6_prefix..." gn run-ipv6-updown.sh down $emit_ipv6_event_dev $emit_ipv6_prefix colecho "...done" gn EOF pre_shutdown_hooks="$pre_shutdown_hooks /var/run/emit-ipv6-down-event" end_script fi fi fi