Beispiel #1
0
def download_caine(dldir=DOWNLOAD_DIR):
    if not dldir.isdir():
        print "creating downloads directory..."
        dldir.mkdir()
    basename = path(CAINE_FILENAME).basename()
    dest = dldir / basename
    if not dest.exists():
        cmd = ['cp', '-a', CAINE_FILENAME, str(dest)]
        subprocess.check_call(cmd)
    mysum = md5sum(file(dest))
    if mysum == CAINE_MDSUM:
        print "Success, md5sum of caine image matches. :)"
    else:
        msg = "Improper file:  Please remove %s and try again." % filename
        raise RuntimeError, msg
Beispiel #2
0
def download_clonezilla(url, dldir=DOWNLOAD_DIR):
    if not dldir.isdir():
        print "creating downloads directory..."
        dldir.mkdir()
    basename = local_basename(url)
    filename = dldir / basename
    if filename.isfile():
        print "Clonezilla already downloaded: %s" % basename
    else:
        cmd = ['wget', url, '-O', filename]
        subprocess.call(cmd)
    mysum = md5sum(file(filename))
    if mysum == CLONEZILLA_MDSUM:
        print "Success, md5sum of clonezilla matches. :)"
    else:
        raise RuntimeError, "Improper file:  Please remove %s and try again." % filename
Beispiel #3
0
def download_clonezilla(url, dldir=DOWNLOAD_DIR):
    if not dldir.isdir():
        print "creating downloads directory..."
        dldir.mkdir()
    basename = local_basename(url)
    filename = dldir / basename
    if filename.isfile():
        print "Clonezilla already downloaded: %s" % basename
    else:
        cmd = ["wget", url, "-O", filename]
        subprocess.call(cmd)
    mysum = md5sum(file(filename))
    if mysum == CLONEZILLA_MDSUM:
        print "Success, md5sum of clonezilla matches. :)"
    else:
        raise RuntimeError, "Improper file:  Please remove %s and try again." % filename