ssh 登录发送提示

#!/bin/bash

key=''

now=$(date "+%Y.%m.%d_%H.%M.%S")
hostname=$(hostname | sed 's/\./_/g')
server_ip=$(wget -qO- http://ipecho.net/plain | xargs echo)
local_ip=$(hostname -I| cut -d' ' -f1)
login_ip=`echo $SSH_CONNECTION | cut -d " " -f 1`

title='登录提醒'
desc="服务器IP ${server_ip} ${local_ip}, 登录IP ${login_ip},用户名 ${USER},时间 ${now}。"

wget -q  --timeout=1 --spider https://api.day.app/${key}/"${title}"/"${desc}"?group=${local_ip}

你可能感兴趣的:(ssh 登录发送提示)