diff options
author | Alexander Sulfrian <alex@spline.inf.fu-berlin.de> | 2012-07-27 14:37:51 +0200 |
---|---|---|
committer | www-data <www-data@vm-staticweb.spline.inf.fu-berlin.de> | 2012-07-27 14:37:51 +0200 |
commit | 676e7ac3abb5eb9d956a702adec2a21b97cb4ed6 (patch) | |
tree | a79dec9a9b78a743054b8a277a0668891ed65756 /bin/comics/calvin | |
parent | 0783f3e5a0b48bb61e436aa3b0c418f7506ba296 (diff) | |
download | comics-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/comics/calvin')
-rwxr-xr-x | bin/comics/calvin | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/bin/comics/calvin b/bin/comics/calvin index 1cfd0ec..edbe7e6 100755 --- a/bin/comics/calvin +++ b/bin/comics/calvin @@ -1,7 +1,15 @@ #!/bin/bash -source $(pwd)/$(dirname $0)/../../etc/settings.sh -tmp=$(mktemp -d) +if [ -z "$1" -o ! -d "$1" ]; then + echo "Usage: $0 <top-directory> [<days ago>]" 1>&2 + exit 1 +fi + +top="${1}" +shift + +source "${top}/etc/settings.sh" +tmp="$(mktemp -d)" cd "${tmp}" newn="${day}.gif" |