# vim: syn=sh ts=4 sts=4 sw=4 smartindent expandtab gitea-add-user() { if [ $# -ne 4 ]; then echo $# echo "gitea-add-user " return 2 fi local host=$1 local email=$2 local username=$3 local password=$4 curl --request POST --url https://${host}/user/sign_up \ --header 'content-type: application/x-www-form-urlencoded'\ --data user_name=$username \ --data email=$email \ --data password=$password \ --data retype=$password local retcode=$? if [ $retcode -ne 0 ]; then echo "unable to add user $username!" return 4 fi local mail="$(cat </dev/null) ]; then mutt -H - $email <<<"$mail" #elif [ -n $(which send-email 2>/dev/null) ]; then fi retcode=$? if [ $retcode -ne 0 ]; then Email not sended! return 5 fi return 0 }