dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit e0c16021fc3db33688ecc30eef9eb09f276bfa98
parent 3ba4cc42e229b6eaafd41a598ce6dafad0113589
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Mon, 20 Aug 2018 20:34:08 +0200

Add --border option to add 10%-wide border around image

Diffstat:
Mlinks/bin/upload | 17++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/links/bin/upload b/links/bin/upload @@ -3,9 +3,20 @@ host="idkfa.ucsd.edu" user="ad" # host="adamsgaard.dk" # user="andersdc" -rsync -ravz --progress -e "ssh" "$1" "$user"@"$host":/var/www/html/files_nonpub/ -url="https://$host/files_nonpub/$(basename "$1")" -url="${url// /%20}" + +if [ "$1" = "--border" ] || [ "$1" = "-b" ]; then + uploadfile="$(mktemp)" + basename="border_$(basename "$2")" + convert "$2" -bordercolor White -border 10%x10% "$uploadfile" +else + uploadfile="$1" + basename="$(basename "$1")" +fi + +basename="${basename// /_}" +rsync -rvz --progress --chmod=Fu=rw,Fog=r -e "ssh" "$uploadfile" \ + "${user}@${host}:/var/www/html/files_nonpub/$basename" +url="https://$host/files_nonpub/${basename}" echo -e "\\n$(tput setaf 2)Uploaded to $url (copied to clipboard)$(tput sgr0)" if [ "$(uname)" = "Darwin" ]; then