Created
March 31, 2016 04:26
-
-
Save JCotton1123/4684d868317a8d1c2efea91a22a387c5 to your computer and use it in GitHub Desktop.
Jenkins bulk delete nodes
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
#!/bin/bash | |
cookies="JSESSIONID.8d49441c=1xzuqo2mhtku1pq2q7kvffeud; JSESSIONID.b502a53a=19uzmrp8ggsplp44mageiqqq7; JSESSIONID.6accbce3=zkbcn2gy1qye1h89aan7o6zog; JSESSIONID.b1204f00=11rs98x2idnf01woxy79tmx7ev; hudson_auto_refresh=false; screenResolution=1440x900" | |
base_url="https://jenkins.example.com" | |
while read -r slave_name; do | |
curl -v --cookie "$cookies" "$base_url/computer/$slave_name/doDelete" | |
[ $? ] || exit 1 | |
done < $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment