summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcron-jobs/make_repo_torrents4
-rw-r--r--make_individual_torrent10
2 files changed, 12 insertions, 2 deletions
diff --git a/cron-jobs/make_repo_torrents b/cron-jobs/make_repo_torrents
index c94d073..a5d72a5 100755
--- a/cron-jobs/make_repo_torrents
+++ b/cron-jobs/make_repo_torrents
@@ -46,6 +46,8 @@ do
find "${dir}" -name '*\.pkg\.tar\.xz' |
while read pkg
do
+ pkg_name="${pkg##*/}"
+
if [[ -h "${pkg}" ]] # check if it's a symbolic link
then
# We get the target of the symlink
@@ -56,7 +58,7 @@ do
# `make_individual_torrent' to make it.
if ! [[ -f "${torrent_location}${pkg_name}.torrent" ]]
then
- /srv/http/repo/dbscripts/make_individual_torrent "${pkg}"
+ /srv/http/repo/dbscripts/make_individual_torrent "${pkg}" "${public_location}"
fi
done
done
diff --git a/make_individual_torrent b/make_individual_torrent
index 0cfee56..e5b7d8c 100644
--- a/make_individual_torrent
+++ b/make_individual_torrent
@@ -15,8 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This script is called by `make_repo_torrents' to make a torrent. It
-# depends on `mktorrent'. It takes the following arg:
+# depends on `mktorrent'. It takes the following args:
# $1 - path of package
+# $2 - public location
# Comma seperated list of trackers, no spaces
# t67.eu is run by Xylon, hackcoop by fauno & friends
@@ -33,7 +34,14 @@ then
echo 1
fi
+if [[ -z "${2}" ]]
+then
+ echo "Error. Second arg must be the public location."
+ echo 1
+fi
+
pkg="${1}"
+public_location="${2}"
pkg_name="${pkg##*/}"