Hi all,
 for sure this argument has been already discussed 100000000 times, but
actually I tried to find the email where explained the procedure how to
change the configs to fit the GNS scenario...but I couldn't find it.
I'm really sorry if I'm asking again it and thank you to everyone that will
reply.

I'm trying to change the  Ipexpert configs using a script to fit GNS3
network diagram.
 I would love use the RACK, i have plenty of hours, however because I'm
Europe on GTM time, the rack timing is too early in the morning or too late
in the night. So I use the Rack only Saturday or Sunday. For the rest of
the week I must use GNS.

I used the below script, posted by someone in the list, it works great, it
changes the configs, serials are fine... but especially for the switches,
the configs are still not matching the GNS lab.

here is the script
#####################################################################################################
#!/bin/sh
#
#I called it with: ./SerialRename.sh ./IPExpert\ Routing\ and\ Switching\
Volume\ 1/
#


if [ -z "$1" ]; then
   echo "Please call this script quoting the path to the text files in the
LAB-* folders"
   echo "Example: ./this-script '/path/to/IPExpert Routing and Switching
Volume 1'"
   exit 0
fi

# We use the @ symbol so that our serial interface names don't look all
screwy.
#'s@0/1/0@2/2@g' == 's/0\/1\/0/2\/2/g'

   #First, go find the files and rename in bulk and then rename the files
to XXX_adjusted.txt
find "$1" -type f|grep '\.txt$'|grep 'LAB-'|while read line; do
   echo "Processing $line"
   sed -e 's@0/1/0@2/2@g' -e 's@0/2/0@2/0@gi' -e 's@0/0/0@2/0@gi' "$line" >
"${line}_adjusted.txt"

   #Then, there are some extra conditions
   #If R4 then rename 2/0 to 2/2
   if [ $(echo "$line"|grep -c "R4\.txt") -gt 0 ]; then
       sed -i 's@2/0@2/2@gi' "${line}_adjusted.txt"
   fi

   #If R9 or R6 then rename 0/2/1 to 2/1
   if [ $(echo "$line"|grep -c "R9\.txt\|R6\.txt") -gt 0 ]; then
       sed -i 's@0/2/1@2/1@gi' "${line}_adjusted.txt"
   fi

   #If file name starts with Cat then rename FastEthernet to G
   if [ $(echo "$line"|grep -c "Cat") -gt 0 ]; then
       sed -i 's/FastEthernet/G/g' "${line}_adjusted.txt"
   fi

   #If file name IS Cat1 then rename G0/2 G0/13
   #Watch out for DOS vs UNIX file types. They prevented this from working
with EOL=g
   if [ $(echo "$line"|grep -c "Cat1\.txt") -gt 0 ]; then
       sed -i 's@G0/2\r@G0/13@g' "${line}_adjusted.txt"
   fi

done



#####################################################################################################


Is anybody able to help me?

Many thanks to everyone,

Cristiano
_______________________________________________
For more information regarding industry leading CCIE Lab training, please visit 
www.ipexpert.com

Are you a CCNP or CCIE and looking for a job? Check out 
www.PlatinumPlacement.com

http://onlinestudylist.com/mailman/listinfo/ccie_rs

Reply via email to