Skip to content

Instantly share code, notes, and snippets.

@tolleiv
Created October 19, 2015 10:40
Show Gist options
  • Save tolleiv/89e68e3d7887776769dc to your computer and use it in GitHub Desktop.
Save tolleiv/89e68e3d7887776769dc to your computer and use it in GitHub Desktop.
Expect shell script to update all logstash plugins on Linux systems
#!/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