Skip to content

Instantly share code, notes, and snippets.

@krimdomu
Created June 28, 2016 16:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
use Rex::Commands::SimpleCheck;
sub wait_for_system_to_come_back {
my ($server) = @_;
# give some time for the reboot
Rex::Logger::info("Waiting for system reboot of $server...");
sleep 30;
while ( !is_port_open $server, 22 ) {
sleep 1;
}
Rex::Logger::info("System $server is up and running again...");
Rex::Logger::info("Waiting 30 seconds for the services to start up...");
sleep 30;
# reconnect ssh
Rex::get_current_connection_object->reconnect;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment