mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 04:46:41 +00:00
Add simplistic CRC32 checker executable
This commit is contained in:
17
bin/crc32checker
Executable file
17
bin/crc32checker
Executable file
@@ -0,0 +1,17 @@
|
||||
#! /usr/bin/env ruby
|
||||
|
||||
ARGV.each do |path|
|
||||
print "Checking \"#{path}\"... "
|
||||
|
||||
if !File.exists?(path)
|
||||
puts "FILE NOT FOUND"
|
||||
next
|
||||
end
|
||||
|
||||
checksum = `crc32 "#{path}"`.strip.upcase
|
||||
if File.basename(path).upcase.include?(checksum)
|
||||
puts "MATCH (#{checksum})"
|
||||
else
|
||||
puts "FAIL (#{checksum})"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user