fix file path
This commit is contained in:
11
uas.sh
11
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:"
|
||||
|
||||
Reference in New Issue
Block a user