From a59c6e41846d08aa5da59756090e29436e4f61f2 Mon Sep 17 00:00:00 2001 From: mxmehl Date: Mon, 25 Sep 2017 16:43:55 +0200 Subject: [PATCH] fix file path --- uas.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/uas.sh b/uas.sh index 47fb745..2d9b63a 100755 --- a/uas.sh +++ b/uas.sh @@ -34,11 +34,10 @@ fi # Transform to full path PWD=$(pwd) FILE="$1" -FILEABS="$PWD/$FILE" +FILENAME=$(basename $FILE) - -if [ ! -e "$FILEABS" ]; then - echo "File $FILEABS does not exist." +if [ ! -e "$FILE" ]; then + echo "File $FILE does not exist." exit 1 fi @@ -50,9 +49,9 @@ source "$BINDIR"/config.cfg # Replace spaces by underscores for better downloading -DEST=$(echo "$FILE" | sed 's/ /_/g') +DEST=$(echo "$FILENAME" | sed 's/ /_/g') -scp "$FILEABS" "$SSH"/"$DEST" +scp "$FILE" "$SSH"/"$DEST" # Output download link echo "File has been uploaded. Download link:"