Skip to content

Instantly share code, notes, and snippets.

@jstnkndy
Created December 20, 2014 18:54
Show Gist options
  • Save jstnkndy/d98015dc5b6f79395df4 to your computer and use it in GitHub Desktop.
Save jstnkndy/d98015dc5b6f79395df4 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys, requests
def usage():
print 'Usage: python %s ' % sys.argv[0]
def main():
if len(sys.argv) != 5:
usage()
sys.exit(1)
host, username, password, email = sys.argv[1:]
session = requests.Session()
paramsPost = {
"InstallerConfigForm[adminLoginName]": username,
"InstallerConfigForm[adminLoginPwd]": password,
"InstallerConfigForm[confirmPwd]": password,
"InstallerConfigForm[adminName]":"Administrator",
"InstallerConfigForm[adminEmail]": email,
"InstallerConfigForm[siteName]":"LimeSurvey",
"InstallerConfigForm[surveylang]":"en",
"yt0":"Next"}
response = session.post(host+"/index.php/installer/optional", data=paramsPost)
if "Integrity" in response.text:
print "Success"
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment