fix file path

This commit is contained in:
2017-09-25 16:43:55 +02:00
parent 6c5801e05d
commit a59c6e4184

11
uas.sh
View File

@@ -34,11 +34,10 @@ fi
# Transform to full path # Transform to full path
PWD=$(pwd) PWD=$(pwd)
FILE="$1" FILE="$1"
FILEABS="$PWD/$FILE" FILENAME=$(basename $FILE)
if [ ! -e "$FILE" ]; then
if [ ! -e "$FILEABS" ]; then echo "File $FILE does not exist."
echo "File $FILEABS does not exist."
exit 1 exit 1
fi fi
@@ -50,9 +49,9 @@ source "$BINDIR"/config.cfg
# Replace spaces by underscores for better downloading # 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 # Output download link
echo "File has been uploaded. Download link:" echo "File has been uploaded. Download link:"