All pastes #917981 Raw Edit

Mine

public python v1 · immutable
#917981 ·published 2008-02-25 20:35 UTC
rendered paste body
#!/usr/local/bin/python2.4URL = 'http://www.openbsd.org/errata42.html'SHA1 = '24a908827642f19ee046db6ca66f3024eb5a457e'import urllibimport shaimport sysfh = urllib.urlopen(URL)m = sha.new(fh.read())fh.close()h = m.hexdigest()if h != SHA1:        print 'The contents of \'' + URL + '\' have changed.'        fh = open(sys.argv[0], 'r+')        l = fh.readlines()        l[3] = 'SHA1 = \'' + h + '\'\n'        fh.seek(0)        fh.truncate()        fh.writelines(l)        fh.close()