From 74b26b614d269be1a080237da8d5c4b9ebb90400 Mon Sep 17 00:00:00 2001 From: masq Date: Thu, 14 Nov 2024 10:55:59 +0100 Subject: [PATCH] [add] up_share_file.sh --- up_share_file.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 up_share_file.sh diff --git a/up_share_file.sh b/up_share_file.sh new file mode 100755 index 0000000..c51a243 --- /dev/null +++ b/up_share_file.sh @@ -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"