Print this page
4337 eliminate /etc/TIMEZONE


   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License (the "License").
   7 # You may not use this file except in compliance with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.

  23 #
  24 #
  25 
  26 # This script provides a simple GUI for managing labeled zones.
  27 # It provides contextual menus which provide appropriate choices.
  28 # It must be run in the global zone as root.
  29 
  30 # These arguments are accepted, and will result in non-interactive
  31 # (text-only) mode:
  32 #
  33 #       txzonemgr [-c | -d[f]]
  34 #
  35 #       -c      create default zones
  36 #       -d      destroy all zones; prompts for confirmation unless
  37 #               the -f flag is also specified
  38 #       -f      force
  39 #
  40 
  41 # DISP - use GUI (otherwise use non-interactive mode)
  42 DISP=1


 427                 proxyPwd=$(ldapclient list | \
 428                     grep "^NS_LDAP_BINDPASSWD" | cut -d " " -f2)
 429                 proxyDN=$(ldapclient list | \
 430                     grep "^NS_LDAP_BINDDN" | cut -d " " -f 2)
 431                 if [ "$proxyDN" ] ; then
 432                         print "proxy_dn=\"$proxyDN\"" >> ${SYSIDCFG}
 433                         print "proxy_password=\"$proxyPwd\"" >> ${SYSIDCFG}
 434                 fi
 435                 print "profile=$profName" >> ${SYSIDCFG}
 436                 print "profile_server=$ldapaddress }" >> ${SYSIDCFG}
 437                 cp /etc/nsswitch.conf $ZONE_ETC_DIR/nsswitch.ldap
 438         else
 439                 print "name_service=NONE" > ${SYSIDCFG}
 440                 fi
 441         print "security_policy=NONE" >> ${SYSIDCFG}
 442         locale=$(locale|grep LANG | cut -d "=" -f2)
 443         if [[ -z $locale ]] ; then
 444                 locale="C"
 445         fi
 446         print "system_locale=$locale" >> ${SYSIDCFG}
 447         timezone=$(grep "^TZ" /etc/TIMEZONE|cut -d "=" -f2)
 448         print "timezone=$timezone" >> ${SYSIDCFG}
 449         print "terminal=vt100" >> ${SYSIDCFG}
 450         rootpwd=$(grep "^root:" /etc/shadow|cut -d : -f2)
 451  
 452 #       There are two problems with setting the root password:
 453 #               The zone's shadow file may be read-only
 454 #               The password contains unparsable characters
 455 #       so the following line is commented out until this is resolved.
 456 
 457         #print "root_password=$rootpwd" >> ${SYSIDCFG}
 458         print "nfs4_domain=dynamic" >> ${SYSIDCFG}
 459         print "network_interface=PRIMARY {" >> ${SYSIDCFG}
 460 
 461         net=$(zonecfg -z $zonename info net)
 462         ipType=$(zonecfg -z $zonename info ip-type|cut -d" " -f2)
 463         if [ $ipType = exclusive ] ; then
 464                 hostname=$(zenity --entry \
 465                     --title="$title" \
 466                     --width=330 \
 467                     --text="${zonename}0: Enter Hostname or dhcp: ")




   3 # CDDL HEADER START
   4 #
   5 # The contents of this file are subject to the terms of the
   6 # Common Development and Distribution License (the "License").
   7 # You may not use this file except in compliance with the License.
   8 #
   9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10 # or http://www.opensolaris.org/os/licensing.
  11 # See the License for the specific language governing permissions
  12 # and limitations under the License.
  13 #
  14 # When distributing Covered Code, include this CDDL HEADER in each
  15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16 # If applicable, add the following below this CDDL HEADER, with the
  17 # fields enclosed by brackets "[]" replaced with your own identifying
  18 # information: Portions Copyright [yyyy] [name of copyright owner]
  19 #
  20 # CDDL HEADER END
  21 #
  22 # Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23 # Copyright 2014 Garrett D'Amore
  24 #
  25 #
  26 
  27 # This script provides a simple GUI for managing labeled zones.
  28 # It provides contextual menus which provide appropriate choices.
  29 # It must be run in the global zone as root.
  30 
  31 # These arguments are accepted, and will result in non-interactive
  32 # (text-only) mode:
  33 #
  34 #       txzonemgr [-c | -d[f]]
  35 #
  36 #       -c      create default zones
  37 #       -d      destroy all zones; prompts for confirmation unless
  38 #               the -f flag is also specified
  39 #       -f      force
  40 #
  41 
  42 # DISP - use GUI (otherwise use non-interactive mode)
  43 DISP=1


 428                 proxyPwd=$(ldapclient list | \
 429                     grep "^NS_LDAP_BINDPASSWD" | cut -d " " -f2)
 430                 proxyDN=$(ldapclient list | \
 431                     grep "^NS_LDAP_BINDDN" | cut -d " " -f 2)
 432                 if [ "$proxyDN" ] ; then
 433                         print "proxy_dn=\"$proxyDN\"" >> ${SYSIDCFG}
 434                         print "proxy_password=\"$proxyPwd\"" >> ${SYSIDCFG}
 435                 fi
 436                 print "profile=$profName" >> ${SYSIDCFG}
 437                 print "profile_server=$ldapaddress }" >> ${SYSIDCFG}
 438                 cp /etc/nsswitch.conf $ZONE_ETC_DIR/nsswitch.ldap
 439         else
 440                 print "name_service=NONE" > ${SYSIDCFG}
 441                 fi
 442         print "security_policy=NONE" >> ${SYSIDCFG}
 443         locale=$(locale|grep LANG | cut -d "=" -f2)
 444         if [[ -z $locale ]] ; then
 445                 locale="C"
 446         fi
 447         print "system_locale=$locale" >> ${SYSIDCFG}
 448         timezone=$(grep "^TZ" /etc/default/init|cut -d "=" -f2)
 449         print "timezone=$timezone" >> ${SYSIDCFG}
 450         print "terminal=vt100" >> ${SYSIDCFG}
 451         rootpwd=$(grep "^root:" /etc/shadow|cut -d : -f2)
 452  
 453 #       There are two problems with setting the root password:
 454 #               The zone's shadow file may be read-only
 455 #               The password contains unparsable characters
 456 #       so the following line is commented out until this is resolved.
 457 
 458         #print "root_password=$rootpwd" >> ${SYSIDCFG}
 459         print "nfs4_domain=dynamic" >> ${SYSIDCFG}
 460         print "network_interface=PRIMARY {" >> ${SYSIDCFG}
 461 
 462         net=$(zonecfg -z $zonename info net)
 463         ipType=$(zonecfg -z $zonename info ip-type|cut -d" " -f2)
 464         if [ $ipType = exclusive ] ; then
 465                 hostname=$(zenity --entry \
 466                     --title="$title" \
 467                     --width=330 \
 468                     --text="${zonename}0: Enter Hostname or dhcp: ")