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
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:"