EXPECT - Show-CONFIGURATION Fortigate.expect.sh

From Wiki.IT-Arts.net


#!/usr/bin/expect -f

 

# define  remote  Fortigate device and ssh port with username

set host "192.168.1.99"

set port "22"

set user "admin_ro"

 

 

spawn ssh "-p $port" "$user\@$host"

#comment the line below if the device has no vdoms

expect " $ " { send "config global\r" }

expect " $ " { send "show  full-configuration\r" }

###Exit from device

expect " $ " { send "exit\r" }


Useful Links