EXPECT - Show-CONFIGURATION Fortigate.expect.sh

From IT-Arts.net
Revision as of 15:51, 8 December 2025 by Admin (talk | contribs) (Text replacement - "Category:Post-It" to "Category:Wiki")


#!/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" }