System information

Sharing and maintaining SLES 10 SP2 Linux under z/VM 67
# Enable my 191 (A) disk
#+--------------------------------------------------------------------------+
{
chccwdev -e 191 > /dev/null 2>&1
rc=$?
if [ $rc != 0 ]; then # unable to enable 191 disk
echo "$0: Unable to enable 191, rc from chccwdev = $rc"
exit 1
fi
sleep 1# wait a sec to be sure disk is ready
Adisk=/dev/$(egrep '^0.0.0191' /proc/dasd/devices | awk '{print $7}')
}
#+--------------------------------------------------------------------------+
function findSourceIP()
# Get the source IP address and hostName
#+--------------------------------------------------------------------------+
{
sourceParm="$sourceID.$parmType"
cmsfslst -d $Adisk | grep $sourceID | grep $parmType > /dev/null
rc=$?
if [ $rc != 0 ]; then
echo "$0: $sourceParm not found on 191 minidisk. Exiting"
exit 2
fi
export local $(cmsfscat -a -d $Adisk $sourceParm)
# set global variable names escaping any dots (.) in the strings
sourceName=$(echo "$Hostname" | sed -e 's:\.:\\\.:g')
sourceHost=${Hostname%%.*} # Chop domain name off to leave host name
sourceIP=$(echo "$HostIP" | sed -e 's:\.:\\\.:g')
sourceOSA=$(echo "$ReadChannel " | sed -e 's:\.:\\\.:g')
}
#+--------------------------------------------------------------------------+
function findTargetIP()
# Get my new IP address and hostname
#+--------------------------------------------------------------------------+
{
targetParm="$targetID.$parmType"
cmsfslst -d $Adisk | grep $targetID | grep $parmType > /dev/null
rc=$?
if [ $rc != 0 ]; then
echo "$0: $targetParm not found on 191 minidisk. Exiting"
exit 3
fi
export local $(cmsfscat -a -d $Adisk $targetParm)
targetName=$Hostname
targetHost=${Hostname%%.*} # Chop domain name off to leave host name
targetIP=$HostIP
}
#+--------------------------------------------------------------------------+
function modifyIP()
# Modify IP address and host name in /etc/HOSTNAME, /etc/hosts and
# /etc/sysconfig/network/ifcfg-qeth-bus-ccw-$ReadChannel
#+--------------------------------------------------------------------------+
{
# TODO: this function should also modify, DNS, Gateway, broadcast, etc.
eth0file="/etc/sysconfig/network/ifcfg-qeth-bus-ccw-$ReadChannel"
echo ""