Created
October 19, 2015 10:40
-
-
Save tolleiv/89e68e3d7887776769dc to your computer and use it in GitHub Desktop.
Expect shell script to update all logstash plugins on Linux systems
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 | |
set timeout -1 | |
set count 200 | |
spawn /opt/logstash/bin/plugin update | |
while {$count > 0} { | |
set count [expr $count-1]; | |
expect { | |
"(Y/N)?" { | |
send "Y\r" | |
} | |
"Updating logstash" { | |
set count 0 | |
} | |
} | |
} | |
expect "Updated" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment