#!/bin/sh

# This rm script backs up ptp configuration files for TSM 15.5, before the configuration files removed along with tarball



TR_PTP_PATH=/usr/local/natinst/share/TimeSync/TimeReferences



pushd $TR_PTP_PATH



if [ -f ptp.conf ]; then

   BAK_FILENAME=ptp.conf.bak

   if [ -f $BAK_FILENAME ]; then

      BAK_NUMBER=1

      while [ -f $BAK_FILENAME.$BAK_NUMBER ]; do

         let "BAK_NUMBER += 1"

      done

      BAK_FILENAME=$BAK_FILENAME.$BAK_NUMBER

   fi

   mv -f ptp.conf $BAK_FILENAME

   echo "INFO: Moved $PTP_CONF to $BAK_FILENAME"

fi



popd

