summaryrefslogtreecommitdiffstats
path: root/isomd5sum/checkisomd5.c
blob: 6ddd37fdf0d9b7a6d0b611ce78cfa81a38273bd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* simple program to check implanted md5sum in an iso 9660 image   */
/* Copyright 2001 Red Hat, Inc.                                    */
/* Michael Fulbright msf@redhat.com                                */

#include <stdio.h>

#include "md5.h"
#include "libcheckisomd5.h"

int main(int argc, char **argv) {
    int rc;

    if (argc < 2) {
	printf("Usage: checkisomd5 [--md5sumonly] <isofilename>|<blockdevice>\n\n");
	exit(1);
    }

    /* see if they just want md5sum */
    if (strcmp(argv[1], "--md5sumonly") == 0) {
	printMD5SUM(argv[2]);
	exit(0);
    }

    rc = mediaCheckFile(argv[1], 1);

    exit(rc ? 0 : 1);
}