Created
June 28, 2016 16:37
-
-
Save krimdomu/335d01fc0f1e28f2bb7929eaf552eb93 to your computer and use it in GitHub Desktop.
This file contains 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
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