misc/ssh_tg_notify: strip expected stat error message

master
Felix Stupp 2 years ago
parent 27bd516581
commit 8b7d4f1688
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -11,7 +11,7 @@ URL="https://api.telegram.org/bot$KEY/sendMessage"
if [[ "$PAM_SERVICE" == "sshd" && "$PAM_TYPE" == "open_session" && "$PAM_USER" != "git" && -z "$TMUX" ]]; then
IP="$PAM_RHOST"
cache_file="${CACHE_DIR}/${IP}-${PAM_USER}"
cache_mtime=$(stat --format="%Y" "$cache_file")
cache_mtime=$(stat --format="%Y" "$cache_file" 2>/dev/null)
current_time=$(date +%s)
touch "$cache_file"
if (( cache_mtime > (current_time - 4*60*60) )); then

Loading…
Cancel
Save