1*7c478bd9Sstevel@tonic-gate#!/bin/sh 2*7c478bd9Sstevel@tonic-gate# 3*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 4*7c478bd9Sstevel@tonic-gate# 5*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 6*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 7*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 8*7c478bd9Sstevel@tonic-gate# with the License. 9*7c478bd9Sstevel@tonic-gate# 10*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 11*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 12*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 13*7c478bd9Sstevel@tonic-gate# and limitations under the License. 14*7c478bd9Sstevel@tonic-gate# 15*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 16*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 18*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 19*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 20*7c478bd9Sstevel@tonic-gate# 21*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 22*7c478bd9Sstevel@tonic-gate# 23*7c478bd9Sstevel@tonic-gate# 24*7c478bd9Sstevel@tonic-gate# Copyright 2004 Sun Microsystems, Inc. All rights reserved. 25*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 26*7c478bd9Sstevel@tonic-gate# 27*7c478bd9Sstevel@tonic-gate#pragma ident "%Z%%M% %I% %E% SMI" 28*7c478bd9Sstevel@tonic-gate 29*7c478bd9Sstevel@tonic-gate# The -c and -u options are used by system configruation. 30*7c478bd9Sstevel@tonic-gateUSAGE="$0 [-c|-u]" 31*7c478bd9Sstevel@tonic-gateTEXTDOMAIN="SUNW_OST_OSCMD" 32*7c478bd9Sstevel@tonic-gateexport TEXTDOMAIN 33*7c478bd9Sstevel@tonic-gate 34*7c478bd9Sstevel@tonic-gate# As of Oct. 1, 1995, any new system shipped will have root 35*7c478bd9Sstevel@tonic-gate# property "energystar-v2" defined in its prom. 36*7c478bd9Sstevel@tonic-gateESTAR_PROP="energystar-v2" 37*7c478bd9Sstevel@tonic-gate 38*7c478bd9Sstevel@tonic-gate# Power Management configuration file 39*7c478bd9Sstevel@tonic-gatePWR_CONF=/etc/power.conf 40*7c478bd9Sstevel@tonic-gateSHUTDOWN_PATTERN="autoshutdown[ ]" 41*7c478bd9Sstevel@tonic-gateTMP=/var/run/tmp1.$$ 42*7c478bd9Sstevel@tonic-gate 43*7c478bd9Sstevel@tonic-gate# If this flag is present, user will be asked the autoshutdown 44*7c478bd9Sstevel@tonic-gate# question again even when autoshutdown is already configured. 45*7c478bd9Sstevel@tonic-gateASK_AGAIN_FLAG=/etc/.PM_RECONFIGURE 46*7c478bd9Sstevel@tonic-gate 47*7c478bd9Sstevel@tonic-gate# This is provided for auto-install. 48*7c478bd9Sstevel@tonic-gate# If either of the files is present, autoshutdown will be configured 49*7c478bd9Sstevel@tonic-gate# accordingly silently. 50*7c478bd9Sstevel@tonic-gateSHUTDOWN_ENABLE_FLAG=/autoshutdown 51*7c478bd9Sstevel@tonic-gateSHUTDOWN_DISABLE_FLAG=/noautoshutdown 52*7c478bd9Sstevel@tonic-gate 53*7c478bd9Sstevel@tonic-gate# Autoshutdown is not supported on diskless systems. 54*7c478bd9Sstevel@tonic-gateIS_DISKLESS="" 55*7c478bd9Sstevel@tonic-gate 56*7c478bd9Sstevel@tonic-gate# Default autoshutdown setup. 57*7c478bd9Sstevel@tonic-gateDEFAULT_IDLE_TIME="30" 58*7c478bd9Sstevel@tonic-gateDEFAULT_START_TIME="9:00" 59*7c478bd9Sstevel@tonic-gateDEFAULT_FINISH_TIME="9:00" 60*7c478bd9Sstevel@tonic-gate 61*7c478bd9Sstevel@tonic-gate# Currently autoshutdown setup in the configuration file. 62*7c478bd9Sstevel@tonic-gateCURRENT_IDLE_TIME="" 63*7c478bd9Sstevel@tonic-gateCURRENT_START_TIME="" 64*7c478bd9Sstevel@tonic-gateCURRENT_FINISH_TIME="" 65*7c478bd9Sstevel@tonic-gateCURRENT_BEHAVIOR="" 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate# Autoshutdown confirmation message to be prompted in the question1. 68*7c478bd9Sstevel@tonic-gate# In the following message, each escape sequence requires three 69*7c478bd9Sstevel@tonic-gate# backslashes to prevent the interpretation by the shell and gettext 70*7c478bd9Sstevel@tonic-gate# before being passed to ckyorn. In the message catalog, each message 71*7c478bd9Sstevel@tonic-gate# will have two backslashes. 72*7c478bd9Sstevel@tonic-gateMSG1=`gettext '\\\tAfter 30 minutes of idle time on this system, your system \ 73*7c478bd9Sstevel@tonic-gatestate\\\n\\\twill automatically be saved to disk, and the system will \ 74*7c478bd9Sstevel@tonic-gatepower-off.\\\n\\\n\\\tLater, when you want to use the system again, and \ 75*7c478bd9Sstevel@tonic-gateyou turn the power\\\n\\\tback on, your system will be restored to its \ 76*7c478bd9Sstevel@tonic-gateprevious state,\\\n\\\tincluding all the programs that you were running.\ 77*7c478bd9Sstevel@tonic-gate\\\n\\\n\\\tDo you want this automatic power-saving shutdown?\\\n\ 78*7c478bd9Sstevel@tonic-gate\\\t(If this system is used as a server, answer n)'` 79*7c478bd9Sstevel@tonic-gate 80*7c478bd9Sstevel@tonic-gate# Message to be prompted in question2. 81*7c478bd9Sstevel@tonic-gate# In the following message, each escape sequence requires three 82*7c478bd9Sstevel@tonic-gate# backslashes to prevent the interpretation by the shell and gettext 83*7c478bd9Sstevel@tonic-gate# before being passed to ckyorn. In the message catalog, each message 84*7c478bd9Sstevel@tonic-gate# will have two backslashes. 85*7c478bd9Sstevel@tonic-gateMSG2=`gettext '\\\tDo you want the system to ask about this again, when \ 86*7c478bd9Sstevel@tonic-gateyou next reboot?\\\n\\\t(This gives you the chance to try it before deciding \ 87*7c478bd9Sstevel@tonic-gatewhether\\\n\\\tto keep it.)'` 88*7c478bd9Sstevel@tonic-gate 89*7c478bd9Sstevel@tonic-gate# The autoshutdown comment to be put into the power management config file. 90*7c478bd9Sstevel@tonic-gateSHUTDOWN_COMMENT="# Auto-Shutdown\t\tIdle(min)\tStart/Finish(hh:mm)\tBehavior" 91*7c478bd9Sstevel@tonic-gate 92*7c478bd9Sstevel@tonic-gate# Set up path. 93*7c478bd9Sstevel@tonic-gatePATH="/usr/bin:/usr/sbin:${PATH}" 94*7c478bd9Sstevel@tonic-gateexport PATH 95*7c478bd9Sstevel@tonic-gate 96*7c478bd9Sstevel@tonic-gate# 97*7c478bd9Sstevel@tonic-gate# Get current autoshutdown setup. 98*7c478bd9Sstevel@tonic-gate# 99*7c478bd9Sstevel@tonic-gateget_behavior() { 100*7c478bd9Sstevel@tonic-gate grep -s "$SHUTDOWN_PATTERN" $PWR_CONF > /dev/null 101*7c478bd9Sstevel@tonic-gate if [ $? = 0 ]; then 102*7c478bd9Sstevel@tonic-gate set - `grep "$SHUTDOWN_PATTERN" $PWR_CONF` 103*7c478bd9Sstevel@tonic-gate CURRENT_IDLE_TIME=$2 104*7c478bd9Sstevel@tonic-gate CURRENT_START_TIME=$3 105*7c478bd9Sstevel@tonic-gate CURRENT_FINISH_TIME=$4 106*7c478bd9Sstevel@tonic-gate CURRENT_BEHAVIOR=$5 107*7c478bd9Sstevel@tonic-gate fi 108*7c478bd9Sstevel@tonic-gate} 109*7c478bd9Sstevel@tonic-gate 110*7c478bd9Sstevel@tonic-gate# 111*7c478bd9Sstevel@tonic-gate# Set the autoshutdown behavior in the configuration file. 112*7c478bd9Sstevel@tonic-gate# The autoshutdown token can be preceded by spaces. 113*7c478bd9Sstevel@tonic-gate# The resulting configuration will be based on the first autoshutdown 114*7c478bd9Sstevel@tonic-gate# line if there is more than one in the configuration file. 115*7c478bd9Sstevel@tonic-gate# 116*7c478bd9Sstevel@tonic-gateset_behavior() { 117*7c478bd9Sstevel@tonic-gate BEHAVIOR="$1" 118*7c478bd9Sstevel@tonic-gate 119*7c478bd9Sstevel@tonic-gate grep -s "$SHUTDOWN_PATTERN" $PWR_CONF > /dev/null 120*7c478bd9Sstevel@tonic-gate if [ $? = 0 ]; then 121*7c478bd9Sstevel@tonic-gate set - `grep "$SHUTDOWN_PATTERN" $PWR_CONF` 122*7c478bd9Sstevel@tonic-gate CURRENT_IDLE_TIME=$2 123*7c478bd9Sstevel@tonic-gate CURRENT_START_TIME=$3 124*7c478bd9Sstevel@tonic-gate CURRENT_FINISH_TIME=$4 125*7c478bd9Sstevel@tonic-gate CURRENT_BEHAVIOR=$5 126*7c478bd9Sstevel@tonic-gate fi 127*7c478bd9Sstevel@tonic-gate 128*7c478bd9Sstevel@tonic-gate if [ "$BEHAVIOR" = "unconfigured" ]; then 129*7c478bd9Sstevel@tonic-gate IDLE=$DEFAULT_IDLE_TIME 130*7c478bd9Sstevel@tonic-gate START=$DEFAULT_START_TIME 131*7c478bd9Sstevel@tonic-gate FINISH=$DEFAULT_FINISH_TIME 132*7c478bd9Sstevel@tonic-gate else { 133*7c478bd9Sstevel@tonic-gate if [ "$CURRENT_IDLE_TIME" = "" ]; then 134*7c478bd9Sstevel@tonic-gate IDLE="$DEFAULT_IDLE_TIME" 135*7c478bd9Sstevel@tonic-gate else 136*7c478bd9Sstevel@tonic-gate IDLE="$CURRENT_IDLE_TIME" 137*7c478bd9Sstevel@tonic-gate fi 138*7c478bd9Sstevel@tonic-gate 139*7c478bd9Sstevel@tonic-gate if [ "$CURRENT_START_TIME" = "" ]; then 140*7c478bd9Sstevel@tonic-gate START="$DEFAULT_START_TIME" 141*7c478bd9Sstevel@tonic-gate else 142*7c478bd9Sstevel@tonic-gate START="$CURRENT_START_TIME" 143*7c478bd9Sstevel@tonic-gate fi 144*7c478bd9Sstevel@tonic-gate 145*7c478bd9Sstevel@tonic-gate if [ "$CURRENT_FINISH_TIME" = "" ]; then 146*7c478bd9Sstevel@tonic-gate FINISH="$DEFAULT_FINISH_TIME" 147*7c478bd9Sstevel@tonic-gate else 148*7c478bd9Sstevel@tonic-gate FINISH="$CURRENT_FINISH_TIME" 149*7c478bd9Sstevel@tonic-gate fi 150*7c478bd9Sstevel@tonic-gate } fi 151*7c478bd9Sstevel@tonic-gate 152*7c478bd9Sstevel@tonic-gate grep -v "# Auto-Shutdown[ ]" $PWR_CONF | grep -v "$SHUTDOWN_PATTERN" > $TMP 153*7c478bd9Sstevel@tonic-gate echo $SHUTDOWN_COMMENT >> $TMP 154*7c478bd9Sstevel@tonic-gate echo "autoshutdown\t\t${IDLE}\t\t${START} ${FINISH}\t\t${BEHAVIOR}" >> \ 155*7c478bd9Sstevel@tonic-gate $TMP 156*7c478bd9Sstevel@tonic-gate cp $TMP $PWR_CONF 157*7c478bd9Sstevel@tonic-gate rm $TMP 158*7c478bd9Sstevel@tonic-gate} 159*7c478bd9Sstevel@tonic-gate 160*7c478bd9Sstevel@tonic-gate# 161*7c478bd9Sstevel@tonic-gate# Print out the Energystar guidelines. 162*7c478bd9Sstevel@tonic-gate# 163*7c478bd9Sstevel@tonic-gateprint_estar_guidelines() { 164*7c478bd9Sstevel@tonic-gate echo 165*7c478bd9Sstevel@tonic-gate echo "`gettext '\t================================================================'`" 166*7c478bd9Sstevel@tonic-gate echo "`gettext '\tThis system is configured to conserve energy.'`" 167*7c478bd9Sstevel@tonic-gate echo "`gettext '\t================================================================'`" 168*7c478bd9Sstevel@tonic-gate} 169*7c478bd9Sstevel@tonic-gate 170*7c478bd9Sstevel@tonic-gate# 171*7c478bd9Sstevel@tonic-gate# Ask user for autoshutdown confirmation. 172*7c478bd9Sstevel@tonic-gate# 173*7c478bd9Sstevel@tonic-gatequestion1() { 174*7c478bd9Sstevel@tonic-gate ans=`ckyorn -Q -d y -p "$1"` 175*7c478bd9Sstevel@tonic-gate case $ans in 176*7c478bd9Sstevel@tonic-gate y|yes|Y|Yes|YES) 177*7c478bd9Sstevel@tonic-gate set_behavior shutdown 178*7c478bd9Sstevel@tonic-gate echo 179*7c478bd9Sstevel@tonic-gate echo "`gettext '\tAutoshutdown remains enabled.'`" 180*7c478bd9Sstevel@tonic-gate break 181*7c478bd9Sstevel@tonic-gate ;; 182*7c478bd9Sstevel@tonic-gate n|no|N|No|NO) 183*7c478bd9Sstevel@tonic-gate set_behavior noshutdown 184*7c478bd9Sstevel@tonic-gate echo 185*7c478bd9Sstevel@tonic-gate echo "`gettext '\tAutoshutdown has been disabled.'`" 186*7c478bd9Sstevel@tonic-gate break 187*7c478bd9Sstevel@tonic-gate ;; 188*7c478bd9Sstevel@tonic-gate esac 189*7c478bd9Sstevel@tonic-gate} 190*7c478bd9Sstevel@tonic-gate 191*7c478bd9Sstevel@tonic-gate# 192*7c478bd9Sstevel@tonic-gate# Ask user whether they want to be asked about the question again during 193*7c478bd9Sstevel@tonic-gate# next reboot. 194*7c478bd9Sstevel@tonic-gate# 195*7c478bd9Sstevel@tonic-gatequestion2() { 196*7c478bd9Sstevel@tonic-gate ans=`ckyorn -Q -d n -p "$1"` 197*7c478bd9Sstevel@tonic-gate case $ans in 198*7c478bd9Sstevel@tonic-gate y|yes|Y|Yes|YES) 199*7c478bd9Sstevel@tonic-gate touch $ASK_AGAIN_FLAG 200*7c478bd9Sstevel@tonic-gate echo "`gettext '\n\tThe system will ask you about automatic shutdown at the next reboot.'`" 201*7c478bd9Sstevel@tonic-gate break 202*7c478bd9Sstevel@tonic-gate ;; 203*7c478bd9Sstevel@tonic-gate n|no|N|No|NO) 204*7c478bd9Sstevel@tonic-gate rm -f $ASK_AGAIN_FLAG 205*7c478bd9Sstevel@tonic-gate echo "`gettext '\n\tThe system will not ask you again about automatic shutdown.'`" 206*7c478bd9Sstevel@tonic-gate break 207*7c478bd9Sstevel@tonic-gate ;; 208*7c478bd9Sstevel@tonic-gate esac 209*7c478bd9Sstevel@tonic-gate} 210*7c478bd9Sstevel@tonic-gate 211*7c478bd9Sstevel@tonic-gate 212*7c478bd9Sstevel@tonic-gate################ 213*7c478bd9Sstevel@tonic-gate# Main # 214*7c478bd9Sstevel@tonic-gate################ 215*7c478bd9Sstevel@tonic-gate 216*7c478bd9Sstevel@tonic-gate# 217*7c478bd9Sstevel@tonic-gate# Exit if /etc/power.conf does not exist or is not writable. 218*7c478bd9Sstevel@tonic-gate# 219*7c478bd9Sstevel@tonic-gateif [ ! -f $PWR_CONF -o ! -w $PWR_CONF ]; then 220*7c478bd9Sstevel@tonic-gate exit 1 221*7c478bd9Sstevel@tonic-gatefi 222*7c478bd9Sstevel@tonic-gate 223*7c478bd9Sstevel@tonic-gate 224*7c478bd9Sstevel@tonic-gate# 225*7c478bd9Sstevel@tonic-gate# Usage: sysidpm [-c|-u] 226*7c478bd9Sstevel@tonic-gate# 227*7c478bd9Sstevel@tonic-gateif [ $# -gt 1 ]; then 228*7c478bd9Sstevel@tonic-gate echo $USAGE 229*7c478bd9Sstevel@tonic-gate exit 1 230*7c478bd9Sstevel@tonic-gatefi 231*7c478bd9Sstevel@tonic-gate 232*7c478bd9Sstevel@tonic-gate 233*7c478bd9Sstevel@tonic-gate# 234*7c478bd9Sstevel@tonic-gate# The postinstall script of some power management package should have 235*7c478bd9Sstevel@tonic-gate# added this command into the application list in /etc/.sysidconfig.apps. 236*7c478bd9Sstevel@tonic-gate# System configuration and unconfiguration will call those applications 237*7c478bd9Sstevel@tonic-gate# with option -c and -u respectively. 238*7c478bd9Sstevel@tonic-gate# 239*7c478bd9Sstevel@tonic-gateif [ $# -eq 1 ]; then 240*7c478bd9Sstevel@tonic-gate case $1 in 241*7c478bd9Sstevel@tonic-gate -c) # Does not need to do anything. 242*7c478bd9Sstevel@tonic-gate exit 0 ;; 243*7c478bd9Sstevel@tonic-gate -u) 244*7c478bd9Sstevel@tonic-gate # Reset the behavior back to unconfigured state. 245*7c478bd9Sstevel@tonic-gate set_behavior unconfigured 246*7c478bd9Sstevel@tonic-gate 247*7c478bd9Sstevel@tonic-gate # Remove the statefile line too. 248*7c478bd9Sstevel@tonic-gate grep -v statefile $PWR_CONF > $TMP 249*7c478bd9Sstevel@tonic-gate cp $TMP $PWR_CONF 250*7c478bd9Sstevel@tonic-gate rm $TMP 251*7c478bd9Sstevel@tonic-gate 252*7c478bd9Sstevel@tonic-gate exit 0 ;; 253*7c478bd9Sstevel@tonic-gate *) 254*7c478bd9Sstevel@tonic-gate echo $USAGE 255*7c478bd9Sstevel@tonic-gate exit 1 ;; 256*7c478bd9Sstevel@tonic-gate esac 257*7c478bd9Sstevel@tonic-gatefi 258*7c478bd9Sstevel@tonic-gate 259*7c478bd9Sstevel@tonic-gate 260*7c478bd9Sstevel@tonic-gate# 261*7c478bd9Sstevel@tonic-gate# Get current autoshutdown setup. 262*7c478bd9Sstevel@tonic-gate# 263*7c478bd9Sstevel@tonic-gateget_behavior 264*7c478bd9Sstevel@tonic-gate 265*7c478bd9Sstevel@tonic-gate# 266*7c478bd9Sstevel@tonic-gate# If this is a diskless system, silently disable autoshutdown and exit. 267*7c478bd9Sstevel@tonic-gate# 268*7c478bd9Sstevel@tonic-gateROOT_FSTYPE=`df -n / | (read w1 w2 w3; echo $w3)` 269*7c478bd9Sstevel@tonic-gateif [ $ROOT_FSTYPE != "ufs" ]; then 270*7c478bd9Sstevel@tonic-gate set_behavior noshutdown 271*7c478bd9Sstevel@tonic-gate exit 0 272*7c478bd9Sstevel@tonic-gatefi 273*7c478bd9Sstevel@tonic-gate 274*7c478bd9Sstevel@tonic-gate 275*7c478bd9Sstevel@tonic-gate# 276*7c478bd9Sstevel@tonic-gate# If /autoshutdown is present, silently enable autoshutdown and exit. 277*7c478bd9Sstevel@tonic-gate# 278*7c478bd9Sstevel@tonic-gateif [ -f $SHUTDOWN_ENABLE_FLAG ]; then 279*7c478bd9Sstevel@tonic-gate set_behavior shutdown 280*7c478bd9Sstevel@tonic-gate rm $SHUTDOWN_ENABLE_FLAG 281*7c478bd9Sstevel@tonic-gate exit 0 282*7c478bd9Sstevel@tonic-gatefi 283*7c478bd9Sstevel@tonic-gate 284*7c478bd9Sstevel@tonic-gate# 285*7c478bd9Sstevel@tonic-gate# If /noautoshutdown is present, silently disable autoshutdown and 286*7c478bd9Sstevel@tonic-gate# exit. 287*7c478bd9Sstevel@tonic-gate# 288*7c478bd9Sstevel@tonic-gateif [ -f $SHUTDOWN_DISABLE_FLAG ]; then 289*7c478bd9Sstevel@tonic-gate set_behavior noshutdown 290*7c478bd9Sstevel@tonic-gate rm $SHUTDOWN_DISABLE_FLAG 291*7c478bd9Sstevel@tonic-gate exit 0 292*7c478bd9Sstevel@tonic-gatefi 293*7c478bd9Sstevel@tonic-gate 294*7c478bd9Sstevel@tonic-gate 295*7c478bd9Sstevel@tonic-gate# 296*7c478bd9Sstevel@tonic-gate# If this is an EnergyStar compliant system, the default should 297*7c478bd9Sstevel@tonic-gate# have autoshutdown enabled. However we don't want to surprise 298*7c478bd9Sstevel@tonic-gate# users, so let's confirm with the user. 299*7c478bd9Sstevel@tonic-gate# 300*7c478bd9Sstevel@tonic-gateprtconf -vp | grep -s -w ${ESTAR_PROP} > /dev/null 301*7c478bd9Sstevel@tonic-gateif [ $? = 0 ]; then 302*7c478bd9Sstevel@tonic-gate if [ "$CURRENT_BEHAVIOR" = "unconfigured" -o -f $ASK_AGAIN_FLAG ]; then 303*7c478bd9Sstevel@tonic-gate print_estar_guidelines 304*7c478bd9Sstevel@tonic-gate question1 "$MSG1" 305*7c478bd9Sstevel@tonic-gate question2 "$MSG2" 306*7c478bd9Sstevel@tonic-gate echo "`gettext '\n\tThe \"Power Management\" chapter in the \"Solaris Common Desktop\n\tEnvironment: User Guide\" describes more about how to change\n\tand set workstation energy-saving features.'`" 307*7c478bd9Sstevel@tonic-gate echo 308*7c478bd9Sstevel@tonic-gate fi 309*7c478bd9Sstevel@tonic-gate exit 0 310*7c478bd9Sstevel@tonic-gatefi 311*7c478bd9Sstevel@tonic-gate 312*7c478bd9Sstevel@tonic-gate# 313*7c478bd9Sstevel@tonic-gate# The rest of the cases will have 'default' autoshutdown behavior. 314*7c478bd9Sstevel@tonic-gate# 315*7c478bd9Sstevel@tonic-gateif [ "$CURRENT_BEHAVIOR" = "unconfigured" ]; then 316*7c478bd9Sstevel@tonic-gate set_behavior default 317*7c478bd9Sstevel@tonic-gate exit 0 318*7c478bd9Sstevel@tonic-gatefi 319*7c478bd9Sstevel@tonic-gate 320*7c478bd9Sstevel@tonic-gate# 321*7c478bd9Sstevel@tonic-gate# We are here because either the autoshutdown line has been 322*7c478bd9Sstevel@tonic-gate# removed or the behavior has been configured. It can be a result 323*7c478bd9Sstevel@tonic-gate# of upgrade. In that case, the configuration file should not 324*7c478bd9Sstevel@tonic-gate# be changed. Let's exit. 325*7c478bd9Sstevel@tonic-gateexit 0 326