Skip to content

Instantly share code, notes, and snippets.

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