svc-ripng revision f4b3ec61df05330d25f55a36b975b4d7519fdeb1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#!/sbin/sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# CDDL HEADER START
34f9b3eef6fdadbda0a846aa4d68691ac40eace5Roland Mainz#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# The contents of this file are subject to the terms of the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Common Development and Distribution License (the "License").
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# You may not use this file except in compliance with the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# or http://www.opensolaris.org/os/licensing.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# See the License for the specific language governing permissions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# and limitations under the License.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# When distributing Covered Code, include this CDDL HEADER in each
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# If applicable, add the following below this CDDL HEADER, with the
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# fields enclosed by brackets "[]" replaced with your own identifying
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# information: Portions Copyright [yyyy] [name of copyright owner]
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# CDDL HEADER END
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Use is subject to license terms.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# ident "%Z%%M% %I% %E% SMI"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin. /lib/svc/share/smf_include.sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin. /lib/svc/share/routing_include.sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsmf_configure_ip || exit $SMF_EXIT_OK
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chindaemon_args=`get_daemon_args $SMF_FMRI`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinoptions="sqp:Ptv"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Handle upgrade - routing/daemon-args property must be mapped to properties
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# in routeadm property group. Note the SMF-incompatible -t option is not
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# supported, since it requires that in.ripngd run in the foreground.
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif [ -n "$daemon_args" ]; then
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$options" "q" supply_routes false true
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$options" "s" supply_routes true
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$options" "p" udp_port 521
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$options" "P" poison_reverse false true
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$options" "v" verbose true false
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set_daemon_nonoption_properties "$SMF_FMRI" "$daemon_args" \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "$options" "log_file"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin clear_daemon_args $SMF_FMRI
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Assemble arguments to daemon from properties
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinargs="`get_daemon_option_from_boolean_property $SMF_FMRI \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin supply_routes -q false`"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinargs="$args `get_daemon_option_from_boolean_property $SMF_FMRI \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin supply_routes -s true`"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinargs="$args `get_daemon_option_from_property $SMF_FMRI udp_port p 521`"
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinargs="$args `get_daemon_option_from_boolean_property $SMF_FMRI \
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin poison_reverse -P false`"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinargs="$args `get_daemon_option_from_boolean_property $SMF_FMRI \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin verbose -v true`"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinargs="$args `get_daemon_nonoption_property $SMF_FMRI log_file`"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/usr/lib/inet/in.ripngd $args
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin[ "$?" = 0 ] || exit $SMF_EXIT_ERR_FATAL
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexit "$SMF_EXIT_OK"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin