Commands to support emailing the admin when new users are registered to this Gitea instance.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
GiteaMailNotifications/checkregistration.sh

11 lines
431 B

cd /home/sigonasr2/GiteaMailNotifications
CURRENT=$(curl -s -D - -o /dev/null 'http://sig.projectdivar.com/api/v1/admin/users?token='$(cat .APIKEY) -H 'accept: application/json' | grep "X-Total-Count:")
PREVIOUS=$(cat registeredusers.data)
if [ "$CURRENT" != "$PREVIOUS" ]; then
./notifyregistration.sh
echo $CURRENT > registeredusers.data
echo "New registration detected. Email sent"
else
echo "No new users detected."
fi