2010-09-17 13:40:17 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
/usr/sbin/env-update && source /etc/profile
|
|
|
|
|
|
|
|
announce_url="http://tracker.sabayon.org/tracker.php/announce"
|
|
|
|
iso_dir="/sabayon/iso"
|
|
|
|
cd "${iso_dir}"
|
|
|
|
|
|
|
|
for iso_file in "${iso_dir}"/*.{iso,tar.gz}; do
|
|
|
|
iso_name="${iso_file/.iso}"
|
|
|
|
iso_name="${iso_name/.tar.gz}"
|
2011-10-26 15:34:42 +02:00
|
|
|
# do not make torrents for DAILY iso images
|
|
|
|
is_daily=$(echo ${iso_name} | grep DAILY)
|
|
|
|
if [ -n "${is_daily}" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2010-09-17 13:40:17 +02:00
|
|
|
torrent_file="${iso_file}.torrent"
|
|
|
|
[[ -f "${torrent_file}" ]] && rm "${torrent_file}"
|
|
|
|
iso_file_name="$(basename ${iso_file})"
|
2010-09-28 21:02:54 +02:00
|
|
|
echo "Cooking ${iso_file_name}"
|
2010-09-17 13:40:17 +02:00
|
|
|
mktorrent-borg -nd -a "${announce_url}" -n "${iso_name}" -o "${torrent_file}" "${iso_file_name}" || exit 1
|
|
|
|
done
|