source: src-sh/pc-extractoverlay/ports-overlay/usr/local/bin/crashuploader @ 9c1ae91

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 9c1ae91 was 9c1ae91, checked in by Kris Moore <kris@…>, 14 months ago

Add dataos? pcbsd to uploader post vars

  • Property mode set to 100755
File size: 584 bytes
Line 
1#!/usr/bin/env python
2
3import requests
4import sys
5import os
6
7if len(sys.argv) < 2:
8        print "Usage: %s file" % sys.argv[0]
9        sys.exit(1)
10
11url = 'http://ext-data.ixsystems.com/uploader/list/'
12files = {'docfile': open(sys.argv[1], 'rb')}
13
14data = None
15if os.path.isfile("/etc/hostid"):
16    f = open("/etc/hostid")
17    hostid = f.read().strip()
18    f.close() 
19    data = { 'hostid': hostid }
20
21data['os'] = 'pcbsd'
22
23r = requests.post(url, data=data, files=files)
24#if r.status_code != 200:
25#    print "Bad upload, status code: %s" % r.status_code
26#    print "Response data:"
27#    print r.text
Note: See TracBrowser for help on using the repository browser.