Created
August 28, 2017 19:57
-
-
Save assertivist/0dc26b4de33eeea667c0d70fcff33a59 to your computer and use it in GitHub Desktop.
keeps a ServiceNow developer instance awake, at least until the nightly snooze-all
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 | |
# put your instance id here | |
instance="dev######" | |
# make sure your password doesn't have shell operators in it | |
credentials="admin:password" | |
while true; do | |
entropy=`rand` | |
outdata="{\"short_description\":\"Automated incident $entropy\"}" | |
curl --user $credentials \ | |
--header "Content-Type: application/json" \ | |
--header "Accept: application/json" \ | |
--request POST \ | |
--data "$outdata" \ | |
"https://$instance.service-now.com/api/now/table/incident" | |
echo "\n\n" | |
sleeptime="`rand -M 5`m" | |
echo "created incident, waiting $sleeptime" | |
sleep $sleeptime | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment