From 3a80e4a5832d63417aad5634c464f16b172d0893 Mon Sep 17 00:00:00 2001 From: Thomas Riccardi Date: Sun, 9 Jun 2013 01:56:28 +0200 Subject: If file is found in STORAGE directory, no need for a key or user. --- hib-dlagent | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hib-dlagent b/hib-dlagent index 70e22f4..84f8898 100755 --- a/hib-dlagent +++ b/hib-dlagent @@ -103,6 +103,15 @@ main() { DESTINATION="${FILE##*/}" fi + if [ -n "$STORAGE" ]; then + STORAGE_FILE=$(/usr/bin/find "$STORAGE" -name "$FILE") + if [ -n "$STORAGE_FILE" ]; then + echo "Found file: $STORAGE_FILE" + ln -s "$STORAGE_FILE" "$DESTINATION" + return; + fi + fi + if [ -n "$USERNAME" ]; then login; LISTING_PAGES+=("$HOME_PAGE") @@ -117,15 +126,6 @@ main() { exit 1 fi - if [ -n "$STORAGE" ]; then - STORAGE_FILE=$(/usr/bin/find "$STORAGE" -name "$FILE") - if [ -n "$STORAGE_FILE" ]; then - echo "Found file: $STORAGE_FILE" - ln -s "$STORAGE_FILE" "$DESTINATION" - return; - fi - fi - for LISTING_PAGE in "${LISTING_PAGES[@]}"; do URL=$(discover_url "$LISTING_PAGE") if [ -n "$URL" ]; then break; fi -- cgit v1.2.3-70-g09d2