Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 29 lines (23 sloc) 606 Bytes
#!/usr/bin/env python
import requests
import sys
print """
Jenkins Groovy Console cmd runner.
usage: ./jgc.py [HOST]
Then type any command and wait for STDOUT output from remote machine.
Type 'exit' to exit :)
"""
URL = sys.argv[1] + '/scriptText'
HEADERS = {
'User-Agent': 'jgc'
}
while 1:
CMD = raw_input(">> Enter command to execute (or type 'exit' to exit): ")
if CMD == 'exit':
print "exiting...\n"
exit(0)
DATA = {
'script': 'println "{}".execute().text'.format(CMD)
}
result = requests.post(URL, headers=HEADERS, data=DATA)
print result.text
You can’t perform that action at this time.