mirror of
https://github.com/xdtianyu/scripts.git
synced 2025-08-08 17:17:22 +08:00
add ssh ip geo
This commit is contained in:
10
ssh/sshrc.sh
Executable file
10
ssh/sshrc.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
read -d " " ip <<< $SSH_CONNECTION
|
||||
#date=$(date "+%d.%m.%Y %Hh%M")
|
||||
#reverse=$(dig -x $ip +short)
|
||||
geo=$(curl -s http://ip.xdty.org -X POST -d "geo=$ip")
|
||||
if [ -z "$geo" ];then
|
||||
geo="unknown"
|
||||
fi
|
||||
ip="$ip($geo)"
|
||||
curl -s https://www.xdty.org/mail.php -X POST -d "event=($USER) login from $ip&name=whatever&email=xxxxx@gmail.com" &
|
Reference in New Issue
Block a user