EXPECT - Show-CONFIGURATION Fortigate.expect.sh: Difference between revisions
From IT-Arts.net
m Text replacement - "Category:Post-It" to "Category:Wiki" |
m Text replacement - "Category:Wiki" to "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' " |
||
| Line 1: | Line 1: | ||
[[Category:Wiki]] | [[Category:Wiki]] | ||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | |||
<nowiki> | <nowiki> | ||
Latest revision as of 08:14, 17 January 2026
#!/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" }
