Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (29 sloc) 1.2 kb
#!/bin/bash
#############################################################
# #
# verify-sha1.plugin - plugin that performs sha1check #
# #
#############################################################
# #
# Copyright 2005 by Auke Kok under GPLv2 #
# #
#############################################################
plugin_source_verify_sha1() {
local TMP_MD5
# check if we can handle this type of VFY:
if [ "${2:0:5}" != "sha1:" ] ; then
return 2
fi
debug_msg "plugin_source_verify_sha1 ($@)"
TMP_MD5=$(sha1sum $SOURCE_CACHE/$1 | cut -d " " -f 1-1)
if [ "${2:5}" != "$TMP_MD5" ] ; then
message "${PROBLEM_COLOR}! sha1sum check failed for ${DEFAULT_COLOR}${FILE_COLOR}$1${DEFAULT_COLOR}"
verbose_msg "offending sha1sum: $TMP_MD5"
verbose_msg "should be sha1sum: ${2:5}"
return 1
else
# always return 'continue' plugin value
return 2
fi
}
plugin_register SOURCE_VERIFY plugin_source_verify_sha1
Jump to Line
Something went wrong with that request. Please try again.