[add] up_share_file.sh

This commit is contained in:
masq 2024-11-14 10:55:59 +01:00
parent 683931f6ef
commit 74b26b614d
Signed by: masq
GPG Key ID: 35A0D64DDE13B10F
1 changed files with 17 additions and 0 deletions

17
up_share_file.sh Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/bash
#
# usage: up_share_file.sh FILE [NAME]
exit_nofile()
{
echo "Give a file to upload";
exit 1;
}
test -f "$1" || exit_nofile
FILE="$1"
REMOTE=${2:-`basename "$FILE"`}
echo put "$FILE" "/home/masq/~masq/$REMOTE" | sftp -q masq@share.freepoteries.fr >/dev/null
echo "https://share.freepoteries.fr/~masq/$REMOTE"