This is simple script monitors VPN users and sends notifications to Telegram. It helps network administrators track VPN user activity in real-time.
- OpenVPN Server
- TELEGRAM_TOKEN: Telegram API token.
- CHAT_ID: Telegram chat ID for notifications.
git clone https://github.com/ForensicID/vpn-user.git
chmod +x /path/to/your/directory/vpn_user.sh
bash /path/to/your/directory/vpn_user.sh &
Get the PID
ps aux | grep vpn_user.sh
And then Kill the process
kill -9 PID
Open Cronjob configuration
crontab -e
Adding start the script on Booting Process
@reboot bash /path/to/your/directory/vpn_user.sh &
Create file with your file editor
nano /etc/systemd/system/yourServiceName.service
Adding some configuration for systemd service
[Unit]
Description=Script VPN User Service
After=network.target
[Service]
ExecStart=/path/to/your/directory/vpn_user.sh
User=root
Group=root
Restart=on-failure
[Install]
WantedBy=multi-user.target
Reload the Daemon service for change configuration
systemctl daemon-reload
And then enable and start the vpn user systemd service
systemctl enable yourServiceName.service
systemctl start yourServiceName.service
systemctl status yourServiceName.service