From 6790ac43f2f79fea6adcfef2a10d3c4105574216 Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Sun, 27 Jul 2014 12:07:06 +0100 Subject: fixed loads of mistakes I make --- cron-jobs/make_repo_torrents | 4 +++- make_individual_torrent | 10 +++++++++- 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 . # 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##*/}" -- cgit v1.2.3