Check project status from this line
curl http://$JENKINS_URL/job/$JOB_NAME/api/json | python -mjson.tool
It resets job data in json format. then grep for the string "buildable":
this will give you the option to disable or disable the project.
"buildable": true, --> Project enabled "buildable": false, --> Project Disabled
Then do whatever you want.
source share