EXPECT - Show-CONFIGURATION Fortigate.expect.sh

From Wiki.IT-Arts.net
Revision as of 06:27, 23 September 2025 by Admin (talk | contribs) (Created page with "Category:Post-It <nowiki> #!/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" }</nowiki> == Useful Links == * https://community.fo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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