FastHandle - Automation Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Top     SiteMap

Sidebar


Top     SiteMap

Manager Server

Target Server













.

fhscripts:check_rootpass.exp.html



FastHandle Scripts

check_rootpass.exp

$FHHOME/fhscripts/check_rootpass.exp


How to use

$ check_rootpass.exp  192.168.0.10  'PASSWORD'


check_rootpass.exp

$FHHOME/fhscripts/check_rootpass.exp

#!/usr/bin/expect
#########################################################
#./check_rootpass.exp  $IP '$ROOTPASS'
#
#########################################################

set IP  [lindex $argv 0]
set ROOTPASS [lindex $argv 1]
set LOGINPASS PASSWORD


spawn ssh user01@$IP

expect "password: "
send "$LOGINPASS\r"

expect "$ "
send "LANG=C su -\r"

expect "assword: "
#sleep 1
send "$ROOTPASS\r"

expect "# "
send "exit\r"

expect "$ "
send "exit\r"

interact








FastHandle Scripts



fhscripts/check_rootpass.exp.html.txt ยท Last modified: 2018/01/08 00:05 by kurihara