Created
March 2, 2017 10:15
-
-
Save kinomakino/6982b12dfe2f8203b96f91c09e5867e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
set mortadela [lindex $argv 0] | |
set timeout 60 | |
spawn ssh usuario@ip_fortinet | |
expect "password:" | |
send "tu_clave\r" | |
expect "Terciario" | |
send "config firewall address\r" | |
expect "Terciario (address)" | |
send "edit $mortadela\r" | |
expect ")" | |
send "set subnet $mortadela/32\r" | |
expect ")" | |
send "end\r" | |
expect "Terciario" | |
send "config firewall addrgrp\r" | |
expect ")" | |
send "edit BLACKLIST\r" | |
expect ")" | |
send "append member $mortadela\r" | |
expect ")" | |
send "end\r" | |
expect "Terciario" | |
send "exit\r" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment