Include all required scripts for notifying the admin of Gitea new users
This commit is contained in:
commit
96ebf27566
10
checkregistration.sh
Executable file
10
checkregistration.sh
Executable file
@ -0,0 +1,10 @@
|
||||
cd /home/sigonasr2/GiteaMailNotifications
|
||||
CURRENT=$(curl -s -D - -o /dev/null 'http://sig.projectdivar.com/api/v1/admin/users' -H 'accept: application/json' -H 'authorization: Basic $(cat .APIKEY)' | 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
|
14
notifyregistration.sh
Executable file
14
notifyregistration.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# sendmail command line optons:
|
||||
# -i - do not treat lines starting with dot specially
|
||||
# -t - read recipients lists from message headers: TO,CC,BCC
|
||||
# -v - use verbose mode (describe what is happening)
|
||||
|
||||
/usr/sbin/sendmail -i -t << MESSAGE_END
|
||||
From: Sig <sigonasr2@projectdivar.com>
|
||||
To: sigonasr2@yahoo.com
|
||||
Date: Fri, 5 Aug 2022 10:44:00 -0700
|
||||
Subject: Gitea - New User Registration!
|
||||
|
||||
A new user has registered on your site. You can go approve them now.
|
1
registeredusers.data
Normal file
1
registeredusers.data
Normal file
@ -0,0 +1 @@
|
||||
|
Loading…
x
Reference in New Issue
Block a user