aboutsummaryrefslogtreecommitdiff
path: root/_plugins/generate-torrent.rb
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--_plugins/generate-torrent.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/_plugins/generate-torrent.rb b/_plugins/generate-torrent.rb
index 16779b9..1de9870 100644
--- a/_plugins/generate-torrent.rb
+++ b/_plugins/generate-torrent.rb
@@ -26,11 +26,11 @@ module Jekyll
puts `mktorrent #{TRACKERS} -f -v -d -c '#{document.content}' -n #{file} -w #{webseed} -o #{torrent} #{media}`
end
- checksum_file = "resources/#{name}/#{file}.checksum"
+ checksum_file = "#{torrent}.checksum"
checksum = `sha256sum #{media} #{torrent} | sha256sum | awk '{ print $1 }'`
- if File.exist? checksum_file
+ if File.exist? checksum_file then
unless checksum == File.read(checksum_file)
- raise "Checksum mismatch for '#{media}'.\nRe-generate the torrent files and checksums with:\n\nfind . -type f -name '*.torrent' -or -name '*.checksum' -delete"
+ raise "Checksum mismatch for '#{media}'.\nRe-generate the torrent files and checksums with:\n\nrm '#{torrent}' '#{checksum_file}'"
end
else
puts "Missing checksum for '#{media}', generating..."