FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


fhscripts:get:get_nw_config.sh.html



Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
fhscripts:get:get_nw_config.sh.html [2017/12/31 23:29]
kurihara
fhscripts:get:get_nw_config.sh.html [2018/02/25 00:42]
kurihara ↷ Page moved from fhscripts:get_nw_config.sh.html to fhscripts:get:get_nw_config.sh.html
Line 1: Line 1:
-~~NOTOC~~ 
 [[:index.html#FastHandle Scripts|FastHandle Scripts]] [[:index.html#FastHandle Scripts|FastHandle Scripts]]
 ====== get_nw_config.sh ====== ====== get_nw_config.sh ======
 +$FHHOME/fhscripts/get_nw_config.sh 
 +\\ 
 +{{INLINETOC}} 
 +\\
  
 ===== How to use ===== ===== How to use =====
Line 13: Line 15:
 ===== get_nw_config.sh ===== ===== get_nw_config.sh =====
  
-$FTHOME/fhscripts/get_nw_config.sh+$FHHOME/fhscripts/get_nw_config.sh
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 31: Line 33:
    
 DATE=`date +%Y%m%d_%H%M` DATE=`date +%Y%m%d_%H%M`
-TSERVER=192.168.0.5 +TFTPSERVER=192.168.0.5 
-TUSER=user01 +TFTPUSER=user01 
-TDIR=/home/fasthandle/fhhome/tftp+TFTPDIR=/home/fasthandle/fhhome/tftp 
 + 
 +CONF=${TFTPDIR}/${NWHOST}/${NWHOST}_${DATE}.conf
  
-CONF=${TDIR}/${NWHOST}/${NWHOST}_${DATE}.conf 
  
-# ------------------------------------------ +#---------------------------------------------------------- 
-[ ! -d "${TDIR}" ] && mkdir ${TDIR+[ ! -d "${TFTPDIR}" ] && mkdir ${TFTPDIR
-chmod 777 ${TDIR}+chmod 777 ${TFTPDIR}
  
  
-# ------------------------------------------+#----------------------------------------------------------
 HELP () { HELP () {
    
Line 54: Line 57:
  
 #------------------------------------------- #-------------------------------------------
-GET_SXR () {+GET_SRX () {
  
 expect -c " expect -c "
Line 64: Line 67:
 send \"cli\r\" send \"cli\r\"
 expect \">\" expect \">\"
-send \"show configuration | display set | save ${TUSER}@${TSERVER}:${CONF}\r\"+send \"show configuration | display set | save ${TFTPUSER}@${TFTPSERVER}:${CONF}\r\"
 expect \">\" expect \">\"
 send \"exit\r\" send \"exit\r\"


fhscripts/get/get_nw_config.sh.html.txt · Last modified: 2018/03/29 00:06 by kurihara