i.definit revision 7c478bd95313f5f23a4c958a745db2134aa03244
0N/A#!/bin/sh
0N/A#
0N/A# CDDL HEADER START
0N/A#
0N/A# The contents of this file are subject to the terms of the
0N/A# Common Development and Distribution License, Version 1.0 only
0N/A# (the "License"). You may not use this file except in compliance
0N/A# with the License.
0N/A#
0N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0N/A# or http://www.opensolaris.org/os/licensing.
0N/A# See the License for the specific language governing permissions
0N/A# and limitations under the License.
0N/A#
0N/A# When distributing Covered Code, include this CDDL HEADER in each
0N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0N/A# If applicable, add the following below this CDDL HEADER, with the
0N/A# fields enclosed by brackets "[]" replaced with your own identifying
873N/A# information: Portions Copyright [yyyy] [name of copyright owner]
0N/A#
0N/A# CDDL HEADER END
0N/A#
0N/A#
0N/A#ident "%Z%%M% %I% %E% SMI"
868N/A#
0N/A# Copyright 1993, 2002 Sun Microsystems, Inc. All rights reserved.
0N/A# Use is subject to license terms.
2086N/A#
0N/A
0N/APATH="/usr/bin:/usr/sbin:${PATH}"
0N/Aexport PATH
0N/A
0N/Amsg1="An obsolete timezone setting is detected in /etc/default/init."
0N/Amsg2="The timezone setting will be rewritten to a valid timezone."
0N/A
1689N/Awhile read src dest
1689N/Ado
1689N/A if [ "$UPDATE" != "yes" ] ; then
338N/A cp $src $dest
338N/A else
0N/A if [ ! -f $dest ] ; then
0N/A if [ -f $BASEDIR/etc/TIMEZONE.temp ] ; then
338N/A zone=`sed -n 's/^[ ]*TZ=\([^ ;#]*\).*$/\1/p' $BASEDIR/etc/TIMEZONE.temp`
338N/A if [ "x$zone" = "xROC" ]; then
338N/A echo $msg1
0N/A echo $msg2
1280N/A zone="Asia/Taipei"
2086N/A fi
0N/A sed "s%^[ ]*TZ=\([^ ;#]*\).*\$%TZ=$zone%" $src > $dest
0N/A rm -f $BASEDIR/etc/TIMEZONE.temp
0N/A else
0N/A cp $src $dest
1859N/A fi
1689N/A else
1859N/A grep CMASK $dest > /dev/null 2>&1
1859N/A if [ $? != 0 ]; then
1859N/A echo "CMASK=022" >> $dest
0N/A fi
0N/A zone=`sed -n 's/^[ ]*TZ=\([^ ;#]*\).*$/\1/p' $dest`
1689N/A if [ "x$zone" = "xROC" ]; then
1689N/A echo $msg1
1689N/A echo $msg2
1689N/A sed "s%^[ ]*TZ=\([^ ;#]*\).*\$%TZ=Asia/Taipei%" $dest > /tmp/definit.$$
338N/A cp /tmp/definit.$$ $dest
0N/A rm -f /tmp/definit.$$
0N/A fi
0N/A
0N/A fi
0N/A fi
0N/Adone
0N/A
0N/Aexit 0
0N/A