Skip to content

Instantly share code, notes, and snippets.

@JCotton1123
Created March 31, 2016 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JCotton1123/4684d868317a8d1c2efea91a22a387c5 to your computer and use it in GitHub Desktop.
Save JCotton1123/4684d868317a8d1c2efea91a22a387c5 to your computer and use it in GitHub Desktop.
Jenkins bulk delete nodes
#!/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