mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 12:45:19 +00:00
14 lines
389 B
Bash
Executable file
14 lines
389 B
Bash
Executable file
#!/bin/bash
|
|
|
|
mydir=$(dirname "$0")
|
|
sudo "$mydir/send_login_alert.sh"
|
|
|
|
shell=$(getent passwd $LOGNAME | cut -d: -f7)
|
|
if [ "$SSH_ORIGINAL_COMMAND" = "internal-sftp" ] # command given, so run it
|
|
then
|
|
exec /usr/lib/ssh/sftp-server
|
|
elif [[ -n $SSH_ORIGINAL_COMMAND ]]; then
|
|
exec "$shell" -c "$SSH_ORIGINAL_COMMAND"
|
|
else # no command, so interactive login shell
|
|
exec "$shell" -il
|
|
fi
|