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

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

Update crashuploader to latest from FreeNAS

  • Property mode set to 100755
File size: 723 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 = 'https://ext-data.ixsystems.com/uploader/list/'
12files = {'docfile': open(sys.argv[1], 'rb')}
13
14data = {}
15if os.path.isfile("/etc/hostid"):
16    f = open("/etc/hostid")
17    hostid = f.read().strip()
18    f.close() 
19    data = { 'hostid': hostid }
20
21if os.path.isfile("/etc/version"):
22    f = open("/etc/version")
23    version = f.read().strip()
24    f.close()
25    data['version'] = version
26
27data['os'] = 'pcbsd'
28
29r = requests.post(url, data=data, files=files)
30#if r.status_code != 200:
31#    print "Bad upload, status code: %s" % r.status_code
32#    print "Response data:"
33#    print r.text
Note: See TracBrowser for help on using the repository browser.