From 4dc7b31623a9e7314017694cb86bc7941aeda848 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Sat, 15 Jun 2013 17:55:39 -0700 Subject: Search PATH for executables instead of hard-coding --- hib-dlagent | 10 +++++----- 1 file 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 -- cgit v1.2.3-54-g00ecf