5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright 1999-2002 Sun Microsystems, Inc. All rights reserved.
25 # Use is subject to license terms.
27 #ident "%Z%%M% %I% %E% SMI"
29 # Default config values used by script
31 ncakmodconf
=/etc
/nca
/ncakmod.conf
32 ncaifconf
=/etc
/nca
/nca.
if
34 default_miss_door
=/var
/run
/nca_httpd_1.door
36 # Function used to parse the interface names from /etc/hostname.* entries
41 '#'* |
'') # Ignore comments, empty lines
43 '*') configinterfaces
="`echo /etc/hostname.*[0-9] \
48 configinterfaces
="$configinterfaces $i"
55 if [ ! -f $ncakmodconf ]; then
56 # If configuration file is missing, just exit
62 # Default is "disabled" so we want to exit
63 [ "x$status" != "xenabled" ] && exit 0
65 if [ -f "$ncaifconf" ]; then
66 readifconf
< $ncaifconf
67 configinterfaces
="`echo $configinterfaces | \
68 /bin/sed 's/.etc.hostname.//g'`"
69 for i
in $configinterfaces; do
70 findinterface
="`echo $i | /bin/grep '[0-9][0-9]*'`"
72 # Need to expand interface (ie. iprb)
73 interface
="`echo /etc/hostname.$i*[0-9] \
74 2>/dev/null | /bin/sed \
75 's/.etc.hostname.//g'`"
76 interfaces
="$interfaces $interface"
78 interfaces
="$interfaces $i"
82 # If we don't have any interfaces configured, exit
83 [ -z "$interfaces" ] && exit 0
85 # Prevent multiple instances of ncaconfd
86 if /bin
/pgrep ncaconfd
> /dev
/null
2>&1; then
87 echo "$0: ncaconfd is already running"
91 /usr
/sbin
/modload
-p $nca
93 # Insert NCA into the stream of all the interfaces configured.
94 interfaces
="`echo $interfaces | /bin/tr ' ' '\012' | \
96 if [ "x$nca_active" != xenabled
]; then
97 /usr
/lib
/inet
/ncaconfd
-l $interfaces
99 /usr
/lib
/inet
/ncaconfd
-al $interfaces
102 if [ "$httpd_door_path" != "$default_miss_door" ]; then
103 # Set the default HTTPD door in NCA via ndd
104 /usr
/sbin
/ndd
-set /dev
/nca httpd_door_path \
111 # Need to reboot the system to stop
112 echo "System reset is required to stop NCA functionality"
117 echo "Usage: $0 { start | stop }"