Skip to content

mcnaveen/GoogleBot-Webhook-Trigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 GoogleBot Webhook Trigger

Fire a webhook when GoogleBot visit your website.

💡 How does it work?

Using tail and grep to monitor the nginx log file. Once it matches the word "GoogleBot" it'll immediately send notification to your telegram

This script is for Nginx webserver. If you're using different one. Please change the path accordingly.

🔧 Script Setup

  • Download the gbotwebhook.sh file on your linux server in root or home (Home Recommended)

  • Open the file and add these values (Required)

webhookURL= PASTE THE WEBHOOK URL HERE
logFile=/var/log/nginx/access.log #Path to your Nginx access log file. (This one is default) 

This logFile path is for Nginx webserver. If you're using different one. Please change accordingly.

  • Now, Make it executable chmod +x gbotwebhook.sh
  • Next Setup systemd for Running this script continuously
# Navigate to this Directory
cd /etc/systemd/system

# Create New Service File
touch gbotwebhook.service

# Create a Service file for systemd service
nano gbotwebhook.service
systemctl daemon-reload
systemctl enable gbotwebhook
systemctl start gbotwebhook
  • You can Check the service status with
systemctl status gbotwebhook

☑ LICENSE

MIT


Shoutout

Similar useful bash scripts: