From b6e8ebd66d22abf5439485985a7851e768c71e8a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 8 Jan 2014 21:04:43 -0500 Subject: Be very careful about using $0. --- cron-jobs/update-web-db | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cron-jobs/update-web-db') diff --git a/cron-jobs/update-web-db b/cron-jobs/update-web-db index 6ced4c1..825eea6 100755 --- a/cron-jobs/update-web-db +++ b/cron-jobs/update-web-db @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/../db-functions" -. "$(dirname $0)/../config" +. "$(dirname "$(readlink -e "$0")")/../db-functions" +. "$(dirname "$(readlink -e "$0")")/../config" # setup paths SPATH="/srv/http/archweb" @@ -14,7 +14,7 @@ REPOS=('community-testing' 'multilib-testing' 'multilib' 'community' 'extra' 'te LOGOUT="/tmp/archweb_update.log" # figure out what operation to perform -cmd="$(basename $0)" +cmd="${0##*/}" if [[ $cmd != "update-web-db" && $cmd != "update-web-files-db" ]]; then die "Invalid command name '$cmd' specified!" fi -- cgit v1.2.3