Author Topic: need help to write code that i can execute through a slicedit customize button  (Read 1804 times)

vineetvijay12

  • Community Member
  • Posts: 29
  • Hero Points: 0
1. Get the current SITE by running following command.

 if [[ `uname` == "Linux" ]]
then IP1=$(/sbin/route -n | grep UG | awk '{print $2}' | awk -F\. '{print $1$2}')
else
  IP1=$(netstat -rn | grep " 0.0.0.0" | head -1 | awk '{print $3}' | awk -F\. '{print $1$2}')
fi
case $IP1
in
 123) SITE=x;;
 124) SITE=y ;;
 125) SITE=z ;;
 *)  unset SITE ;;
esac

2. assign some values to variables.
and get  a variable SITES=$(echo "x y" | sed s/$SITE//)

3. Get the path of File opened and put into a variable.
s:\x\y_z_w\sq\123.tcle

4. convert dos path to unix path

5. check there should be atleash three strings in path like S:\x\y_z_w
otherwise error and fail.

6. rsync command to other site.

Thanks
Vineet