mirror of
https://github.com/HackHerz/pusher
synced 2025-12-06 02:10:19 +00:00
Examples section added
This commit is contained in:
parent
1b7439f60e
commit
9ca0833a48
3 changed files with 26 additions and 0 deletions
16
examples/ssh-notification.md
Normal file
16
examples/ssh-notification.md
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Notification on SSH login
|
||||
|
||||
Maybe you want to receive a notification every time someone logs into your server. Just post this snippet at the end of your **/etc/profile**.
|
||||
|
||||
|
||||
```bash
|
||||
# SSH-login notification
|
||||
if [ -n "${SSH_CLIENT}" ]
|
||||
then
|
||||
TEXT="$(date "+%Y-%m-%d %H:%M:%S") ssh login to ${USER}@$(hostname -f)"
|
||||
TEXT+=" from $(echo "${SSH_CLIENT}" | awk '{print $1}')"
|
||||
pusher -i 297 "${TEXT}"
|
||||
fi
|
||||
```
|
||||
|
||||
Do not forget to change the id (297 in this example) to the one of your own device.
|
||||
Loading…
Add table
Add a link
Reference in a new issue