mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
login alerts
This commit is contained in:
parent
3eb358d618
commit
0e177210f6
10 changed files with 85 additions and 5 deletions
12
wrappers/login_wrapper.sh
Executable file
12
wrappers/login_wrapper.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
mydir=$(dirname "$0")
|
||||
sudo "$mydir/send_login_alert.sh"
|
||||
|
||||
shell=$(getent passwd $LOGNAME | cut -d: -f7)
|
||||
if [[ -n $SSH_ORIGINAL_COMMAND ]] # command given, so run it
|
||||
then
|
||||
exec "$shell" -c "$SSH_ORIGINAL_COMMAND"
|
||||
else # no command, so interactive login shell
|
||||
exec "$shell" -il
|
||||
fi
|
||||
4
wrappers/send_login_alert.sh
Executable file
4
wrappers/send_login_alert.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
mydir=$(dirname "$0")
|
||||
"$mydir/../.venv/bin/python" "$mydir/../send_login_alert.py"
|
||||
Loading…
Add table
Add a link
Reference in a new issue