Home About BC DR HA Support Training Download
You are here: Home/ GlobalSysAdmin/ Power5/ Please Login or Register

-
Current Location
-

js
  GlobalSysAdmin
    Power5
-
AIX Admin Methodology
Global Consolidation Project
All AIX admins should join
www.aixexpert.com


Join our LinkedIn Group
AIX Advanced Technical Experts
Contract Opportunities

www.LinkedIn.com

-
digg Digg this page
del.icio.us Post to del.icio.us
Slashdot Slashdot it!


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com


#!/usr/bin/ksh93.att
################################################################
#### 
#### Description: Script to change the time zone variable (TZ) in
#### the /etc/environment file.  The TZ variable is modified to
#### reflect the new DST changes.
#### 
#### Central US 	TZ=CST6CDT,M3.2.0,M11.1.0
#### 
################################################################
function mkversion {
  typeset FNAME
  typeset F

  FNAME="${1:?ERROR: Syntax \"${0} fileName\"}"
  [[ ! -f ${FNAME} ]] && echo "ERROR: ${FNAME} does not exist" && return 1

  for F in $( ls -1r ${FNAME}.+([0-9]) 2>/dev/null )
  do
    [[ ! -w ${F} ]] && echo "ERROR: ${F} is not writeable" && return 2
    [[ ! -r ${F} ]] && echo "ERROR: ${F} is not readable" && return 3
    [[ ! -w ${F%/*} ]] && echo "ERROR: . is not writeable" && return 4
  done
  for F in $( ls -1r ${FNAME}.+([0-9]) 2>/dev/null )
  do
    cp -f ${F} ${FNAME}.$(( ${F#${FNAME}.} + 1 )) || return 5
  done
  cp -f "${FNAME}" "${FNAME}.0"
}
################################################################
function chenv {
  typeset ENVFILE="/etc/environment"
  typeset ENVFILE="./environment"
  typeset TMPFILE="/tmp/environment.${$}.tmp"
  typeset VARNAME="TZ"
  typeset OLDVAL="CST6CDT"
  typeset NEWVAL="${OLDVAL},M3.2.0,M11.1.0"

  if [[ ! -w "${ENVFILE}" ]]
  then
    print -u 2 -- "# ERROR: ${ENVFILE} is not writable by this user"
    exit 1
  fi

  print -- "# current ${ENVFILE} ${VARNAME} variable is defined as follows:"
  grep "^${VARNAME}=" "${ENVFILE}"

  mkversion "${ENVFILE}"

  exec 3<"${ENVFILE}"
  exec 4>"${TMPFILE}"
  while IFS="" read -u 3 -r -- LINE
  do
      if [[ "_${LINE}" == _${VARNAME}=${OLDVAL}* ]]
      then
          print -u 4 -- "${VARNAME}=${NEWVAL}"
      else
          print -u 4 -r -- "${LINE}"
      fi
  done
  exec 3<&-
  exec 4>&-

  if cp -f "${TMPFILE}" "${ENVFILE}"
  then
    print -- "# successfully modified ${ENVFILE} ${VARNAME} variable as follows:"
    grep "^${VARNAME}=" "${ENVFILE}"
  else
    print -- "# ERROR: unable to modify ${ENVFILE}"
  fi

  rm -f "${TMPFILE}"
  return 0
}
################################################################

chenv "${@}"

-
DST TZ Modification Script
-
 

DST Updates at MX0
DST Updates at MX1


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com