Skip to content

Instantly share code, notes, and snippets.

@makewhatis
Created November 6, 2015 17:41
Show Gist options
  • Save makewhatis/41dd2d086b9cfcb83f92 to your computer and use it in GitHub Desktop.
Save makewhatis/41dd2d086b9cfcb83f92 to your computer and use it in GitHub Desktop.
hudson = Hudson.instance
for (slave in hudson.slaves) {
def computer = slave.computer
if (slave.getComputer().isTemporarilyOffline()) {
if (!slave.getComputer().getOfflineCause().toString().contains("toggled by")) {
computer.setTemporarilyOffline(false, slave.getComputer().getOfflineCause())
}
} else {
slave.computer.connect(true)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment