summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anderson <ejona86@gmail.com>2013-06-15 17:55:39 -0700
committerEric Anderson <ejona86@gmail.com>2013-06-15 17:56:35 -0700
commit4dc7b31623a9e7314017694cb86bc7941aeda848 (patch)
treeccf40667157a0f2e33afd51ad2e4250301cc8483
parent6c9e8d2a34fe5f4965494c292b359edb2843e64c (diff)
downloadhib-dlagent-4dc7b31623a9e7314017694cb86bc7941aeda848.tar.gz
hib-dlagent-4dc7b31623a9e7314017694cb86bc7941aeda848.zip
Search PATH for executables instead of hard-coding
-rwxr-xr-xhib-dlagent10
1 files changed, 5 insertions, 5 deletions
diff --git a/hib-dlagent b/hib-dlagent
index 5afc79d..2c3a467 100755
--- a/hib-dlagent
+++ b/hib-dlagent
@@ -15,13 +15,13 @@ KEYS=()
STORAGE=
login() {
- /usr/bin/curl -s --cookie-jar "$COOKIE_JAR" \
+ curl -s --cookie-jar "$COOKIE_JAR" \
--data "username=$USERNAME" --data "password=$PASSWORD" "$LOGIN_PAGE"
}
discover_url() {
local LISTING_PAGE="$1"
- /usr/bin/curl -s --cookie "$COOKIE_JAR" "$LISTING_PAGE" | grep "/$FILE?" | \
+ curl -s --cookie "$COOKIE_JAR" "$LISTING_PAGE" | grep "/$FILE?" | \
sed -e "s/.* data-web='\([^']*\)'.*/\1/" | head -n 1
}
@@ -86,7 +86,7 @@ handle_download() {
if [ $DOWNLOAD -eq 0 ]; then
echo "$URL"
else
- /usr/bin/curl -C - --retry 3 --retry-delay 3 -o "$SAVE_FILE" "$URL"
+ curl -C - --retry 3 --retry-delay 3 -o "$SAVE_FILE" "$URL"
fi
}
@@ -166,7 +166,7 @@ main() {
handle_download "$DESTINATION"
else
local STORAGE_FILE
- STORAGE_FILE=$(/usr/bin/find "$STORAGE" -name "$FILE")
+ STORAGE_FILE=$(find "$STORAGE" -name "$FILE")
if [ -z "$STORAGE_FILE" ]; then
STORAGE_FILE="$STORAGE/$FILE"
handle_download "$STORAGE_FILE"
@@ -181,7 +181,7 @@ main() {
# because having relative links is nicer and we will undo any symlinks
# in the path. Therefore, we detect when things have broken and only
# use readlink when we must.
- STORAGE_FILE=$(/usr/bin/readlink -f "$STORAGE_FILE")
+ STORAGE_FILE=$(readlink -f "$STORAGE_FILE")
rm "$DESTINATION"
ln -s "$STORAGE_FILE" "$DESTINATION"
fi