repo: fmrl-client
action: blob
revision: 
path_from: fmrl-update-avatar
revision_from: refs/heads/trunk:
path_to: 
revision_to: 
git.thebackupbox.net
fmrl-client
git clone git://git.thebackupbox.net/fmrl-client

blob of:

fmrl-client

/ fmrl-update-avatar

blob_plain of this file

refs/heads/trunk:/fmrl-update-avatar

 #!/usr/bin/env bash
 me="$(fmrl-whoami)"

 if [ "$1" = "-m" ];then
   shift
   me="$1"
   shift
 fi

 case "$me" in
 *@*)
   printf "" #NOP
 ;;
 *)
   printf "I don't know who you are. TODO: usage statement." >&2
   exit 1
 ;;
 esac

 if [ ! "$1" ];then
   printf 'missing filename!\n' >&2
   exit 2
 fi

 file="$1"

 user="$(cut -d@ -f1 <<< "${me}")"
 host="$(cut -d@ -f2 <<< "${me}")"

 curl \
 	-T "$1" \
 	-g https://${host}/.well-known/fmrl/user/${user}/avatar