commit f57a1a4ac54fac5ead9a3356eac1bb110d8134d9 parent ce70afae000aef4813246c1cd5c6767a240427f2 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Tue, 31 Jul 2018 11:51:55 +0200 Add upload script to transfer files to files_nonpub on web server Diffstat:
A | links/bin/upload | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/links/bin/upload b/links/bin/upload @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +host="idkfa.ucsd.edu" +rsync -ravz --progress -e "ssh" "$1" ad@"$host":/var/www/html/files_nonpub/ +url="https://$host/files_nonpub/$(basename "$1")" +echo -e "\\n$(tput setaf 2)Uploaded to $url (copied to clipboard)$(tput sgr0)" + +if [ "$(uname)" = "Darwin" ]; then + echo -n "$url" | pbcopy +else + echo -n "$url" | xclip +fi