#!/bin/sh
# ----------------------------------------------------------------
# file   : postop8k.sh
# purpose: Script to run post operations on a template generation.
# author : Vittal.S Alexandros C.
#
# usage  : postop8k.sh
#
# modifications:
# 16-03-11  Initial Creation .
# 05-07-16  MTU bond adjustment
# ----------------------------------------------------------------

### Constants
_SELF_="$(basename "$(readlink -e "${BASH_SOURCE[0]}")" && echo X)" && \
readonly _SELF_="${_SELF_%$'\nX'}"
_SELFDIR_="$(dirname "$(readlink -e "${BASH_SOURCE[0]}")" && echo X)" && \
readonly _SELFDIR_="${_SELFDIR_%$'\nX'}"
readonly COMMONINC="${_SELFDIR_}/common8k"

### Include files
source ${COMMONINC} || exit 1
EXPORTMTUDIR=${RAMDIR}/export/etc/sysconfig/network
#Check if osv_version is available
OSV_VERSION=$(whereis -b osv_version.sh | awk '{ print $2 }')
if [ ! -f "$OSV_VERSION" ]; then
   logger --id $$ --priority user.warning "$0: osv_version.sh not found in \$PATH ($PATH), exiting!" >/dev/null 2>&1
   exit 1
fi

fixemptydomain( ) {
   if [ "$domainname" = "" ];
   then
      if [ -f ${SYSPARM} ];
      then
         cat $SYSPARM | sed -e "/\/FQDN/s/$primhost\./$primhost/g" -e "/\/DNSSRV/s/$primhost\./$primhost/g" \
                            -e "/\/FQDN/s/$sechost\./$sechost/g"    -e "/\/DNSSRV/s/$sechost\./$sechost/g"   \
                      > ${SYSPARM}.new
         cp ${SYSPARM}.new ${SYSPARM}
         rm -f ${SYSPARM}.new
      fi
   fi
}

addroute( )
{
   routetype=$1
   defaultroute=$2
   defaultdev=$3
   if [ "$defaultroute" != "" ];
   then
      grep -qw "$defaultroute" $ROUTES
      if [ $? -ne 0 ];
      then
         if [ "$routetype" = "subnet" ];
         then
           echo "$defaultroute - - $defaultdev" >> $ROUTES
         else
           echo "default $defaultroute - $defaultdev" >> $ROUTES
         fi
      fi
   fi
}

setuptimezone( )
{
   # Update system clock timezone
   TIMEZ=${POSTOPTDIR}/etc/sysconfig/clock
   timezone="`fcfgread $CFG8k timezone`"
   if [ ! -f $TIMEZ ];
   then
      cp -p --preserve --parents /etc/sysconfig/clock $POSTOPTDIR
   fi
   echo "postop: Detected timezone-$timezone"
   sed -e "s|^TIMEZONE=.*|TIMEZONE=\"$timezone\"|" $TIMEZ > ${TIMEZ}.tz
   cp -f ${TIMEZ}.tz $TIMEZ
   rm -f ${TIMEZ}.tz
   
   # Update system local timezone
   if [ -f /usr/share/zoneinfo/$timezone ];
   then
       # In V9/SLES12 /etc/localtime is a symlink to /usr/share/zoneinfo/$timezone
       # In SLES12 create symlink to user's timezone, else copy it over (V8R1 and below)
       if "$OSV_VERSION" --major compare "$buildid" ge V9;
       then
           ln -sf /usr/share/zoneinfo/$timezone ${POSTOPTDIR}/etc/localtime
       else
           cp -p --preserve /usr/share/zoneinfo/$timezone ${POSTOPTDIR}/etc/localtime
       fi
   fi
}

setupsaDev( )
{
   SADEVCFG=${POSTOPTDIR}/etc/opt/SMAW/SMAWhaext/saDevSwitch.cfg
   if [ -f $SADEVCFG ];
   then
      slaughternode="`fcfgread $CFG8k first_node_to_switchover` `fcfgread $CFG8k preferred_node_to_takeover`"
      for idx in $slaughternode
      do
         if [ "$idx" = "node1" ];
         then
            cat $SADEVCFG | sed -e s/^NODE_RESET_DELAY.*:/NODE_RESET_DELAY=$sechost:/  > ${SADEVCFG}.new
         else
            cat $SADEVCFG | sed -e s/^NODE_RESET_DELAY.*:/NODE_RESET_DELAY=$primhost:/ > ${SADEVCFG}.new
         fi
         cp -f ${SADEVCFG}.new ${SADEVCFG}
         rm -f ${SADEVCFG}.new
      done
   fi
}

extendsnmp( )
{
   CUSTCONF=${POSTOPTDIR}/opt/SMAW/SMAWrtp/cust_conf
   if "$OSV_VERSION" --major compare "$buildid" ge V7;
   then
      for alarmfilter in AltHiqAlarmFilters.tcn HiqAlarmFilters.tcn
      do
         if [ -f ${CUSTCONF}/$alarmfilter ];
         then
            cat ${CUSTCONF}/$alarmfilter | sed -e /2::0$/s/$/::::::/g \
                                         > ${CUSTCONF}/${alarmfilter}.new
            cp -f ${CUSTCONF}/${alarmfilter}.new ${CUSTCONF}/$alarmfilter
            rm -f ${CUSTCONF}/${alarmfilter}.new

            # For V9 add the extra columns
            if "$OSV_VERSION" --major compare "$buildid" ge V9;
            then
	       
               #numfields=`cat ${CUSTCONF}/$alarmfilter | grep -m 1 "^[0-9].*" |  awk -F"::" '{print NF}'`
               #if [ $numfields -eq 8 ]
               #then
                  #cat ${CUSTCONF}/$alarmfilter | sed -e 's/\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*.*\)/\10::0::0::::/g' \
                  cat  ${CUSTCONF}/${alarmfilter}  | awk -F"::" '{ if ( ($0 ~ '/\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*.*\)/') && ( NF == 8 ) ) { print $0"::0::0::::"; } \
                     else print $0 } ' > ${CUSTCONF}/${alarmfilter}.new	
                  cp -f ${CUSTCONF}/${alarmfilter}.new ${CUSTCONF}/$alarmfilter
                  rm -f ${CUSTCONF}/${alarmfilter}.new
               #fi
            fi
         fi
      done
   fi
}

extendsolid( ) {
   if "$OSV_VERSION" --major compare "$buildid" ge V7;
   then
       SOLINI=${POSTOPTDIR}/var/RtpDb/solid.ini
       SOLINITEMPLATE=/var/RtpDb/solid.ini.S96orig
       for idx in $SOLINI $SOLINITEMPLATE
       do
          if [ -f $idx ];
          then
             sed -i 's/FileSpec_1.*/FileSpec_1 =  \/home\/solid\/RtpDb\/solid.db 4294967296/' $idx
          fi   
       done
   fi
}

addaliastohost( )
{
   if [ "$1" != "" -a "$2" != "" ];
   then
      HOSTS=${POSTOPTDIR}/etc/hosts
      {
         cat ${HOSTS} | sed -e "/$2/d" 
         if [ "$nodesep" = "normal" ];
         then
            echo "$1 $2"
         else
            echo "$1 $2 ${2}_prim ${2}_sec"
         fi
      } > ${HOSTS}.new
      cp ${HOSTS}.new ${HOSTS}
      rm -f ${HOSTS}.new
   fi
}

normps( ) {
   PsMediaHome="/var/hiqpstar/patch"
   #<NormalizeOrder>
   if [ -d $PsMediaHome ];
   then
        pushd $PsMediaHome
        for cpsidx in `find $PsMediaHome -maxdepth 1 -name V[0-9]R\*.tar`
        do
           basepatch=`basename $cpsidx .tar | awk -F'.' '{print $1"."$2}'`
           curbaseepatch=`basename $cpsidx .tar | awk -F'.' '{printf $3}'`
           baseepatch=`basename $cpsidx .tar | awk -F'.' '{printf "%04d",$3}'`
           if [ "$cpsidx" != "$PsMediaHome/$basepatch.$baseepatch.tar" ];
           then
              echo "   - Renaming $basepatch.$baseepatch.tar"
              tar -xf $basepatch.$curbaseepatch.tar
              rm -f $basepatch.$curbaseepatch.tar
              mv $basepatch.$curbaseepatch $basepatch.$baseepatch
              tar -cf $basepatch.$baseepatch.tar $basepatch.$baseepatch
              rm -rf $basepatch.$baseepatch
           fi
        done
        popd
   fi
   #</NormalizeOrder>
}

#@fn adjustmtu
#@description : Set the mtu size of each bond zen generated  config file according to node.cfg and exported config files
#args : arg1: the device(e.g bond0) 
#       arg2 : the mtu size
# @return 0 on success, otherwise error

adjustmtu() {

   local _mtudev=$1
   local _mtuval=$2
   
   local cfgmtufile="$POSTOPTDIR/etc/sysconfig/network/ifcfg-${_mtudev}"
   local cur_mtu=$(cat $POSTOPTDIR/etc/sysconfig/network/ifcfg-${_mtudev} | grep MTU | awk -F"=" '{print $2}' | sed -e "s/'//g")
   if [ "${_mtuval}" != "" -a -f "$cfgmtufile" ];
   then
     if [ "${_mtuval}" != "$cur_mtu" ]
     then
        echo ${_mtuval} | grep -e '^[[:digit:]]\+$'
        if [ $? -ne 0 ]
        then
           echo "not numeric value for mtu ${_mtuval}"
           return 1
        fi

        sed -i "s/MTU=.*/MTU='${_mtuval}'/g" $cfgmtufile
        echo "replaced MTU from ${cur_mtu} to ${_mtuval} for ${cfgmtufile}"
     fi
   fi
  
   return 0
}
mynode=`uname -n`
POSTOPTDIR=/software/dynamic/target
REFPOSTOPTDIR=/software/dynamic/template
CFG8k=$POSTOPTDIR/etc/hiq8000/node.cfg
CFG8kUUID=$POSTOPTDIR/etc/hiq8000/node.cfg.uuid
REFCFG8k=$REFPOSTOPTDIR/etc/hiq8000/node.cfg
SYSPARM=$POSTOPTDIR/opt/SMAW/SMAWrtp/cust_conf/SrxSystemDependent.parm

#<SetNodeCfg>
   mkdir -p $POSTOPTDIR/etc/hiq8000
   cp -f node.cfg ${POSTOPTDIR}/etc/hiq8000/node.cfg
#</SetNodeCfg>

getcfgvar $CFG8k srx_build_id  buildid
getcfgvar $CFG8k domain_name   domainname
primvar=node_1_name
secvar=node_2_name
primvarip=node_1_ip
secvarip=node_2_ip
getcfgvar $CFG8k test_bed      testbed
getcfgvar $CFG8k $primvar      primhost
getcfgvar $CFG8k $secvar       sechost
getcfgvar $CFG8k $primvarip    primip
getcfgvar $CFG8k $secvarip     secip
getcfgvar $CFG8k solution      solution 
getcfgvar $CFG8k hardware_platform_id hwplatid
if [ "$mynode" = "$primhost" ];
then
   othernode=$sechost
else
   othernode=$primhost
fi

#<SetupNodeRef>
   buildprim=false
   echo "Mynode: $mynode, PrimHost: $primhost, SecHost: $sechost"
   if [ "$1" != "" ];
   then
      echo "postop8k: Overriding default detection, primary=$1."
      buildprim=$1
   else
      if [ "$mynode" = "$primhost" -o -f /mnt/node.cfg.primary ];
      then
         buildprim=true
      else
         buildprim=false
      fi
   fi
   
   if [ "$buildprim" = "true" ];
   then
      echo "postop8k: Working on primary node."
   else
      echo "postop8k: Working on secondary node."
   fi
#</SetupNodeRef>

normps

#<NoDomainName>
   if [ -f ${POSTOPTDIR}/etc/HOSTNAME ];
   then
      cat ${POSTOPTDIR}/etc/HOSTNAME | sed -e 's/\.[ \t]*$//g' > ${POSTOPTDIR}/etc/HOSTNAME._t
      cp  ${POSTOPTDIR}/etc/HOSTNAME{._t,}
      rm -f ${POSTOPTDIR}/etc/HOSTNAME._t
   fi
#</NoDomainName>

#<TrimNetmasks>
if [ -f ${POSTOPTDIR}/etc/netmasks ];
then
   echo "postop: Working on netmasks."
   cat ${POSTOPTDIR}/etc/netmasks | sed -e '/^[ \t]*$/d' | sort | uniq > ${POSTOPTDIR}/etc/netmasks._t
   cp ${POSTOPTDIR}/etc/netmasks{._t,} 
   rm -f ${POSTOPTDIR}/etc/netmasks._t
fi
#<TrimNetmasks>

#<RebuildBond3>
   primcipgw="`fcfgread $CFG8k xch_1_gateway`"
   seccipgw="`fcfgread $CFG8k xch_2_gateway`"
   primcipgw=${primcipgw:-"0.0.0.0"}
   seccipgw=${seccipgw:-"0.0.0.0"}
   primcipnw="`fcfgread $CFG8k nafo3| awk '{ print $7 }'`"
   seccipnw="`fcfgread $CFG8k nafo3| awk '{ print $10 }'`"
   primcipnm="`fcfgread $CFG8k nafo3| awk '{ print $6 }'`"
   seccipnm="`fcfgread $CFG8k nafo3| awk '{ print $9 }'`"
   nodesep="`fcfgread $CFG8k node_separation`"
   if [ "$buildprim" = "true" ];
   then
      bonddev="`fcfgread $CFG8k nafo3| awk '{ print $2 }'`"
      cfgadmin="`fcfgread $CFG8k nafo0| awk '{ print $4 }'`"
      cfgcip="`fcfgread $CFG8k nafo3| awk '{ print $4 }'`"
   else
      bonddev="`fcfgread $CFG8k nafo3| awk '{ print $3 }'`"
      cfgadmin="`fcfgread $CFG8k nafo0| awk '{ print $5 }'`"
      cfgcip="`fcfgread $CFG8k nafo3| awk '{ print $5 }'`"
   fi
   if [ "$testbed" = "cluster" ];
   then
      mkdir -p ${POSTOPTDIR}/etc/sysconfig/network
      if [ "$buildprim" = "true" ];
      then
         if [ "$nodesep" = "none" -o "$cfgadmin" != "$cfgcip" ];
         then
            echo "$seccipnw $primcipgw $seccipnm"
         else
            echo "$primcipnw $seccipgw $primcipnm"
         fi
      else
         if [ "$nodesep" = "none" -o "$cfgadmin" != "$cfgcip" ];
         then
            echo "$primcipnw $seccipgw $primcipnm"
         else
            echo "$seccipnw $primcipgw $seccipnm"
         fi
      fi > ${POSTOPTDIR}/etc/sysconfig/network/ifroute-${bonddev}
   fi
#<RebuildBond3>

   ROUTES=${POSTOPTDIR}/etc/sysconfig/network/routes
   mkdir -p ${POSTOPTDIR}/etc/sysconfig/network
   if [ -f $ROUTES ];
   then
   #<RebuildV6Routes>
      #<RemoveRefV6Routes>
      primrefv6sn="`fcfgread $REFCFG8k subnet_1_ipv6`"
      secrefv6sn="`fcfgread $REFCFG8k subnet_2_ipv6`"
      primrefv6gw="`fcfgread $REFCFG8k default_router_1_ipv6`"
      secrefv6gw="`fcfgread $REFCFG8k default_router_2_ipv6`"
      egrepcmd=""
      for v6idx in "$primrefv6sn" "$secrefv6sn" "$primrefv6gw" "$secrefv6gw"
      do
         if [ "$v6idx" = "" ];
         then
            continue
         fi
         if [ "$egrepcmd" = "" ];
         then
            egrepcmd="$v6idx"
         else
            egrepcmd="$egrepcmd|$v6idx"
         fi
      done
      if [ "$egrepcmd" != "" ];
      then
         cat $ROUTES | egrep -v "$egrepcmd" > ${ROUTES}.new
         cp -f ${ROUTES}.new ${ROUTES} 
         rm -f ${ROUTES}.new
      fi
      #</RemoveRefV6Routes>

   if [ "$buildprim" = "true" ];
   then
      primsigdev="`fcfgread $CFG8k nafo1| awk '{ print $2 }'`" 
      primv6sn="`fcfgread $CFG8k subnet_1_ipv6`"
      primv6gw="`fcfgread $CFG8k default_router_1_ipv6`"
      addroute subnet "$primv6sn" "$primsigdev"
      addroute router "$primv6gw" "$primsigdev"
   else
      secsigdev="`fcfgread $CFG8k nafo1| awk '{ print $3 }'`" 
      secv6sn="`fcfgread $CFG8k subnet_2_ipv6`"
      secv6gw="`fcfgread $CFG8k default_router_2_ipv6`"
      addroute subnet "$secv6sn" "$secsigdev"
      addroute router "$secv6gw" "$secsigdev"
   fi
   #</RebuildV6Routes>

   fi

#<RemoveInvalidDomain>
if [ -f ${POSTOPTDIR}/etc/HOSTNAME ];
then
   cat ${POSTOPTDIR}/etc/HOSTNAME | sed -e 's/\.[ \t]*$//' > ${POSTOPTDIR}/etc/HOSTNAME._t
   cp ${POSTOPTDIR}/etc/HOSTNAME{._t,} 
   rm -f ${POSTOPTDIR}/etc/HOSTNAME._t
fi
#</RemoveInvalidDomain>

#<RemoveBonds>
if [ "$buildprim" = "true" ];
then
   cat ${POSTOPTDIR}/etc/hiq8000/node.cfg| \
   grep -e "^[ \t]*nafo" | awk -F':' '{ print $2 }' | \
   awk '{ print $2 }'    | grep -v "^$" | sort | uniq \
   > /tmp/ifcfg-sys
else
   cat ${POSTOPTDIR}/etc/hiq8000/node.cfg| \
   grep -e "^[ \t]*nafo" | awk -F':' '{ print $2 }' | \
   awk '{ print $3 }'    | grep -v "^$" | sort | uniq \
   > /tmp/ifcfg-sys
fi
for idx in eth0 eth1 eth2 eth3 eth4 eth5 eth6 eth7 bond0 bond1 bond2 bond3
do
   ifcfgfile=${POSTOPTDIR}/etc/sysconfig/network/ifcfg-${idx}
   routefile=${POSTOPTDIR}/etc/sysconfig/network/ifroute-${idx}
   grep -q $idx /tmp/ifcfg-sys
   if [ $? -ne 0 ];
   then
      rm -f $ifcfgfile
      rm -f $routefile
   else
      if [ -f $ifcfgfile ];
      then
         cat $ifcfgfile | sed -e "s/(/'/g" -e "s/)/'/g" > ${ifcfgfile}._t
         cp ${ifcfgfile}{._t,}
         rm -f ${ifcfgfile}._t
      fi
   fi
done
rm -f /tmp/ifcfg-sys
#</RemoveBonds>

#<adjustMTU>
 for nafoidx in nafo0 nafo1 nafo2 nafo3
   do
      cfgmtu="`fcfgread ${POSTOPTDIR}/etc/hiq8000/node.cfg $nafoidx| awk '{ print $12 }'`"
      if [ "$buildprim" = "true" ];
      then
         mtudev="`fcfgread ${POSTOPTDIR}/etc/hiq8000/node.cfg $nafoidx| awk '{ print $2 }'`"
      else
         mtudev="`fcfgread ${POSTOPTDIR}/etc/hiq8000/node.cfg $nafoidx| awk '{ print $3 }'`"
      fi

      if [ -f ${EXPORTMTUDIR}/ifcfg-${mtudev} ]
      then
         exp_cur_mtu=$(cat ${EXPORTMTUDIR}/ifcfg-${mtudev} | grep MTU | awk -F"=" '{print $2}' | sed -e "s/'//g")   
         if [ ${exp_cur_mtu} -gt 1000 ]
         then
            if [ "${exp_cur_mtu}" != "${cfgmtu}" ]
            then
               echo "Will use MTU value ${exp_cur_mtu} from ${EXPORTMTUDIR}/ifcfg-${mtudev} instead of node.cfg value ${cfgmtu}"
               cfgmtu="${exp_cur_mtu}"
            else
               echo "Will use MTU value ${cfgmtu}"
            fi
         else
            echo  "Will use MTU value from node.cfg  ${cfgmtu} instead of ${exp_cur_mtu} from ${EXPORTMTUDIR}/ifcfg-${mtudev}"
         fi
      fi

      adjustmtu $mtudev $cfgmtu
   done
#</adjustMTU>

#<UpdateSrxParms>
   #[1]. SFTP ciphers.
   getcfgvar $CFG8k sftp_ssh_cipher cipher
   if [ "$cipher" = "" ];
   then
      cipher="aes128-cbc,3des-cbc,aes192-cbc,aes256-cbc"
   fi
   
   #[2]. Standalone service 
   getcfgvar $CFG8k stand_alone_service_permitted standalone
   if [ "$standalone" = "Yes" ];
   then
      standalone="RtpTrue"
   else
      standalone="RtpFalse"
   fi

   #[3]. Node separation
   getcfgvar $CFG8k node_separation nodesep
   if [ "$nodesep" = "separate" ];
   then
      nodesep="RtpTrue"
   else
      if [ "$testbed" = "simplex" -a "$solution" = "25" ];
      then
         nodesep="RtpTrue"
      else
         nodesep="RtpFalse"
      fi
   fi

   HOSTS=$POSTOPTDIR/etc/hosts
   if [ "$nodesep" = "RtpTrue" -a -f $HOSTS ];
   then
      ipfailover=RtpFalse
      for idx in ncs_ip_alias sip_ip_alias csta_ip_alias lsm_ip_alias
      do
         if [ "$idx" = "lsm_ip_alias" ];
         then
            cat $HOSTS | sed -e "s/${idx}\b/${idx} ${idx}_prim ${idx}_sec/g"         \
                           > ${HOSTS}.new 
         else
            cat $HOSTS | sed -e "s/${idx}_1\b/${idx}_1 ${idx}_1_prim ${idx}_1_sec/g" \
                             -e "s/${idx}_2\b/${idx}_2 ${idx}_2_prim ${idx}_2_sec/g" \
                             -e "s/${idx}_3\b/${idx}_3 ${idx}_3_prim ${idx}_3_sec/g" \
                             -e "s/${idx}_4\b/${idx}_4 ${idx}_4_prim ${idx}_4_sec/g" \
                           > ${HOSTS}.new 
         fi
         cp ${HOSTS}.new $HOSTS
         rm -f ${HOSTS}.new
      done
   else
      ipfailover=RtpTrue
   fi
   
   if [ -f ${SYSPARM} ];
   then
      #<SedBug?>
      if [ -s ${SYSPARM} ];
      then
         count=0
         while [ $count -le 4 ];
         do
            cat ${SYSPARM} | sed -e "/Srx.Usc.SupportedCiphers/s/=.*/= $cipher/g"                          \
                                 -e "/Srx.Main.StandAloneService/s/=.*/= $standalone/g"                    \
                                 -e "/Srx.Main.NodeSeparation/s/=.*/= $nodesep/g"                          \
                                 -e "/SipAddress.1.Failover/s/=.*/= $ipfailover/g"                         \
                                 -e "/SipAddress.2.Failover/s/=.*/= $ipfailover/g"                         \
                                 -e "/SipServerAddress.1.Failover/s/=.*/= $ipfailover/g"                   \
                                 -e "/SipServerAddress.2.Failover/s/=.*/= $ipfailover/g"                   \
                                 -e "/NcsAddress.1.Failover/s/=.*/= $ipfailover/g"                         \
                                 -e "/NcsAddress.2.Failover/s/=.*/= $ipfailover/g"                         \
                                 -e "/CstaAddress.1.Failover/s/=.*/= $ipfailover/g"                        \
                                 -e "/CstaAddress.2.Failover/s/=.*/= $ipfailover/g"                        \
                                 -e "/LsmAddress.1.Failover/s/=.*/= $ipfailover/g"                         \
                                 -e "/Srx.Sip.1.DummyConnectionIpAddr/s/=.*/= $primip/g"                   \
                                 -e "/Srx.Sip.2.DummyConnectionIpAddr/s/=.*/= $secip/g"                    \
                                 -e "s/Srx.Main.Hw.*/Srx\/Main\/HwVersion customer string = $hwplatid/g"   \
                           > ${SYSPARM}.new
            if [ ! -s ${SYSPARM}.new ];
            then
               echo "[postop8k]: Trying to generate target config files( attempt:$count )"
               sleep 2
            else
               break;
            fi
            count=$[count+1]
         done
      fi
      #</SedBug?>
      cp ${SYSPARM}.new ${SYSPARM}
      rm -f ${SYSPARM}.new
   fi
 
#</UpdateSrxParms>

#<EmptyDoman?>
   fixemptydomain
#</EmptyDoman?>

#<SetSaDev>
   setupsaDev
#</SetSaDev>

#<SetTimeZone>
   setuptimezone
#</SetTimeZone>

#<ExtendSnmpV7+>
   extendsnmp
#<ExtendSnmpV7+>

#<ExtendSolid>
   extendsolid
#</ExtendSolid>

#<SetupIpV6Alias>
   sipV6alias_1="`fcfgread $CFG8k sipsm1_vipV6`"
   sipV6alias_2="`fcfgread $CFG8k sipsm2_vipV6`"
   sipV6alias_3="`fcfgread $CFG8k sipsm3_vipV6`"
   sipV6alias_4="`fcfgread $CFG8k sipsm4_vipV6`"
   addaliastohost "$sipV6alias_1" sip_ipv6_alias_1
   addaliastohost "$sipV6alias_2" sip_ipv6_alias_2
   addaliastohost "$sipV6alias_3" sip_ipv6_alias_3
   addaliastohost "$sipV6alias_4" sip_ipv6_alias_4
#</SetupIpV6Alias>
sync
exit 0 
