summaryrefslogtreecommitdiffstats
path: root/bin/get-comics
diff options
context:
space:
mode:
authorAlexander Sulfrian <alex@spline.inf.fu-berlin.de>2012-07-27 14:37:51 +0200
committerwww-data <www-data@vm-staticweb.spline.inf.fu-berlin.de>2012-07-27 14:37:51 +0200
commit676e7ac3abb5eb9d956a702adec2a21b97cb4ed6 (patch)
treea79dec9a9b78a743054b8a277a0668891ed65756 /bin/get-comics
parent0783f3e5a0b48bb61e436aa3b0c418f7506ba296 (diff)
downloadcomics-676e7ac3abb5eb9d956a702adec2a21b97cb4ed6.tar.gz
comics-676e7ac3abb5eb9d956a702adec2a21b97cb4ed6.tar.bz2
comics-676e7ac3abb5eb9d956a702adec2a21b97cb4ed6.zip
bin: supply top directory to fetch scripts
If calling get-commics with absolute pathe the fetching scripts got something like /var/www/comics.spline.de//var/www/comics.spline.de/ as absolute path. This fixes this issue by changing the working directory to the top level directory and getting the path with $(pwd) one time and supply the top directory to the fetching scripts as first argument.
Diffstat (limited to 'bin/get-comics')
-rwxr-xr-xbin/get-comics8
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/get-comics b/bin/get-comics
index 73f6d39..472344d 100755
--- a/bin/get-comics
+++ b/bin/get-comics
@@ -11,16 +11,16 @@ else
daysago=$1
fi
-top="$(pwd)/$(dirname $0)/../"
-for update in comics/* ; do
+top="$( cd "$(dirname "$0")/../" >/dev/null 2>&1 && pwd )"
+for update in ${top}/bin/comics/* ; do
comic=$(basename $update)
if [ "$output" = "true" ]; then
- ${update} $daysago &
+ ${update} "${top}" "${daysago}" &
else
myDate=$(date -Im --date "$daysago days ago")
echo "---------------- $myDate ----------------" >> ${top}/log/${comic}.log
- ${update} $daysago >> ${top}/log/${comic}.log 2>&1 &
+ ${update} "${top}" "${daysago}" >> ${top}/log/${comic}.log 2>&1 &
fi
sleep 2