EXPECT - Show-CONFIGURATION Fortigate.expect.sh: Difference between revisions

From IT-Arts.net
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..."
 
m Text replacement - "Category:Post-It" to "Category:Wiki"
Line 1: Line 1:
[[Category:Post-It]]
[[Category:Wiki]]


  <nowiki>
  <nowiki>

Revision as of 15:51, 8 December 2025


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