Skip to content

Instantly share code, notes, and snippets.

@krimdomu
Created June 28, 2016 16:37
Show Gist options
  • Save krimdomu/335d01fc0f1e28f2bb7929eaf552eb93 to your computer and use it in GitHub Desktop.
Save krimdomu/335d01fc0f1e28f2bb7929eaf552eb93 to your computer and use it in GitHub Desktop.
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