diff options
| author | Eric Anderson <ejona86@gmail.com> | 2013-06-15 17:55:39 -0700 | 
|---|---|---|
| committer | Eric Anderson <ejona86@gmail.com> | 2013-06-15 17:56:35 -0700 | 
| commit | 4dc7b31623a9e7314017694cb86bc7941aeda848 (patch) | |
| tree | ccf40667157a0f2e33afd51ad2e4250301cc8483 | |
| parent | 6c9e8d2a34fe5f4965494c292b359edb2843e64c (diff) | |
| download | hib-dlagent-4dc7b31623a9e7314017694cb86bc7941aeda848.tar.gz hib-dlagent-4dc7b31623a9e7314017694cb86bc7941aeda848.zip | |
Search PATH for executables instead of hard-coding
| -rwxr-xr-x | hib-dlagent | 10 | 
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 | 
