diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-08 21:04:43 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-01-08 21:19:01 -0500 |
commit | b6e8ebd66d22abf5439485985a7851e768c71e8a (patch) | |
tree | eec7fafd8aa2285dd3b706bb1e433a0ed10c87e5 /cron-jobs | |
parent | 1d08899c3ac82047fe614a7694e5a7235f808cfd (diff) |
Be very careful about using $0.
Diffstat (limited to 'cron-jobs')
-rwxr-xr-x | cron-jobs/ftpdir-cleanup | 4 | ||||
-rwxr-xr-x | cron-jobs/integrity-check | 4 | ||||
-rwxr-xr-x | cron-jobs/repo-sanity-check | 4 | ||||
-rwxr-xr-x | cron-jobs/sourceballs | 2 | ||||
-rwxr-xr-x | cron-jobs/sourceballs2 | 2 | ||||
-rwxr-xr-x | cron-jobs/update-abs-tarballs | 2 | ||||
-rwxr-xr-x | cron-jobs/update-web-db | 6 |
7 files changed, 12 insertions, 12 deletions
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 83e6e17..8d691b5 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/../db-functions" -. "$(dirname $0)/../config" +. "$(dirname "$(readlink -e "$0")")/../db-functions" +. "$(dirname "$(readlink -e "$0")")/../config" clean_pkg() { local pkg diff --git a/cron-jobs/integrity-check b/cron-jobs/integrity-check index d4f9694..05a56a5 100755 --- a/cron-jobs/integrity-check +++ b/cron-jobs/integrity-check @@ -1,6 +1,6 @@ #!/bin/bash -dirname="$(dirname $0)" +dirname="$(dirname "$(readlink -e "$0")")" . "${dirname}/../db-functions" . "${dirname}/../config" @@ -8,7 +8,7 @@ dirname="$(dirname $0)" script_lock if [ $# -ne 1 ]; then - die "usage: $(basename $0) <mailto>" + die "usage: ${0##*/} <mailto>" fi mailto=$1 diff --git a/cron-jobs/repo-sanity-check b/cron-jobs/repo-sanity-check index 1ba90a6..2aa7892 100755 --- a/cron-jobs/repo-sanity-check +++ b/cron-jobs/repo-sanity-check @@ -1,8 +1,8 @@ #!/bin/bash # Solves issue165 -. "$(dirname $0)/../db-functions" -. "$(dirname $0)/../config" +. "$(dirname "$(readlink -e "$0")")/../db-functions" +. "$(dirname "$(readlink -e "$0")")/../config" # Traverse all repos for _repo in ${PKGREPOS[@]}; do diff --git a/cron-jobs/sourceballs b/cron-jobs/sourceballs index ee074bd..73d8432 100755 --- a/cron-jobs/sourceballs +++ b/cron-jobs/sourceballs @@ -1,6 +1,6 @@ #!/bin/bash -dirname="$(dirname $(readlink -e $0))" +dirname="$(dirname "$(readlink -e "$0")")" . "${dirname}/../db-functions" . "${dirname}/../config" pushd "${WORKDIR}" >/dev/null diff --git a/cron-jobs/sourceballs2 b/cron-jobs/sourceballs2 index 5644268..eb46579 100755 --- a/cron-jobs/sourceballs2 +++ b/cron-jobs/sourceballs2 @@ -4,7 +4,7 @@ # Makepkg --allsource every package # Remove the old sourceballs -dirname="$(dirname $(readlink -e $0))" +dirname="$(dirname "$(readlink -e "$0")")" . "${dirname}/../db-functions" . "${dirname}/../config" . "${MAKEPKGCONF}" diff --git a/cron-jobs/update-abs-tarballs b/cron-jobs/update-abs-tarballs index 824ac34..901cc4b 100755 --- a/cron-jobs/update-abs-tarballs +++ b/cron-jobs/update-abs-tarballs @@ -1,6 +1,6 @@ #!/bin/bash -. "$(dirname $0)/../config" +. "$(dirname "$(readlink -e "$0")")/../config" rsync -av --exclude=staging/ parabolagnulinux.org::abstar/ ${FTP_BASE}/ 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 |