FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


fhscripts:fh:fhssh.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
Last revision Both sides next revision
fhscripts:fh:fhssh.sh.html [2018/01/20 22:13]
kurihara
fhscripts:fh:fhssh.sh.html [2019/02/12 23:19]
kurihara
Line 1: Line 1:
 [[:index.html#FastHandle Scripts|FastHandle Scripts]] [[:index.html#FastHandle Scripts|FastHandle Scripts]]
-====== fhssh.sh - auto login script======+====== SSH Auto Login Script without Password (fhssh.sh)======
  
-$FHHOME/fhscripts/fhssh.sh+$FHHOME/bin/fhssh.sh
  
 {{INLINETOC}} {{INLINETOC}}
Line 8: Line 8:
  
  
-===== Operation =====+===== fhssh.sh Operation =====
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
-$ fhssh.sh auth.pro 192.168.0.10+$ fhssh.sh -H 192.168.0.10  auth.pro 
 +$ fhssh.sh -H 192.168.0.11  auth.stg
 </sxh> </sxh>
  
 +== Application Example ==
 +<sxh bash toolbar:false gutter:false>
 +~]$ fhssh.sh -l
 +How to use
 +  fhssh.sh -H x.x.x.x  auth.pro
 +  fhssh.sh -H x.x.x.x  auth.stg
 +  fhssh.sh -H x.x.x.x  auth.dev
 +  fhssh.sh -H x.x.x.x  auth.srx_pro
 +  fhssh.sh -H x.x.x.x  auth.srx_dev
 +~]$
 +</sxh>
  
 \\ \\
 ===== fhssh.sh ===== ===== fhssh.sh =====
  
-$FHHOME/fhscripts/fhssh.sh+$FHHOME/bin/fhssh.sh
  
 <sxh bash toolbar:false gutter:false> <sxh bash toolbar:false gutter:false>
Line 25: Line 37:
 # #
 # How to use # How to use
-#    fhssh.sh  auth.pro xx.xx.xx.xx+#    fhssh.sh  -l   <- list command 
 +#    fhssh.sh  -h 
 +#    fhssh.sh  -H xx.xx.xx.xx  auth.pro 
 +#    fhssh.sh  -H xx.xx.xx.xx  auth.stg
 #===================================================================== #=====================================================================
  
 HELP () { HELP () {
     echo "How to use"     echo "How to use"
-    cat $0 |grep auth |grep ")"|grep -v "fhssh.sh" |awk -F")" {'print "  fhssh.sh" $1 " x.x.x.x"'}+    cat $0 |grep auth |grep ")"|grep -v "fhssh.sh" |awk -F")" {'print "  fhssh.sh -H x.x.x.x"  $1'} 
 +    exit 0
 } }
  
-AUTH=$1 +ERROR () {
-HOST=$2 +
- +
-# ------------------------------------------ +
-if [ -z $2 ]; then+
     echo ""     echo ""
-    echo 'ERROR: argument is null'+    echo 'ERROR: Option is mistake'
     echo ""     echo ""
 +}
 +
 +case ${1} in
 +  -h|-l) HELP
 +     ;;
 +esac
 +
 +if [ -z ${3} ]; then
 +    ERROR
     HELP     HELP
     exit 1     exit 1
 fi fi
  
 +case ${1} in
 +  -H) :
 +    HOST=$2
 +    AUTH=$3
 +     ;;
 +  *) :
 +    ERROR
 +    HELP
 +    exit 1
 +    ;;
 +esac
  
-------------------------------------------+#=================================================================== 
 +
 +#===================================================================
 SSH_PASS () { SSH_PASS () {
  
Line 126: Line 160:
      SRX      SRX
     ;;     ;;
-  -h|-l) HELP 
-     ;; 
-  *) HELP 
-     exit 
-     ;; 
 esac esac
  
Line 140: Line 169:
 \\ \\
 <WRAP box 90%> <WRAP box 90%>
-<catlist -noAddPageButton -smallHead -sortAscending  -sortAscending>+<catlist ..: -noAddPageButton -smallHead -sortAscending  -sortAscending>
 </WRAP> </WRAP>
  


fhscripts/fh/fhssh.sh.html.txt · Last modified: 2019/02/12 23:20 by kurihara