mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
force ssh login through ttyd
This commit is contained in:
parent
31e2508b0c
commit
457c79620b
2 changed files with 2 additions and 10 deletions
|
@ -21,10 +21,6 @@ if command -v nvim >/dev/null; then
|
|||
alias vim='nvim'
|
||||
alias edit='nvim'
|
||||
fi
|
||||
# show MOTD on ttyd login
|
||||
if [[ -z "${TTY}" && -z "${SSH_TTY}" && -z "${TMUX}" && "$(grep -w 'archboot' /etc/hostname)" ]]; then
|
||||
[[ "${SHLVL}" == "2" ]] && cat /etc/motd
|
||||
fi
|
||||
# run remote-login.sh on ssh connection
|
||||
if [[ -z "${STY}" && -n "${SSH_TTY}" && "$(grep -w 'archboot' /etc/hostname)" ]]; then
|
||||
/usr/bin/remote-login.sh
|
||||
|
|
|
@ -4,12 +4,8 @@
|
|||
|
||||
# simulate login from tty on first screen session
|
||||
if ! screen -ls &>/dev/null; then
|
||||
if [[ -z "${SSH_TTY}" ]]; then
|
||||
_LOGIN=ttyd
|
||||
else
|
||||
_LOGIN=ssh
|
||||
clear
|
||||
fi
|
||||
LOGIN=ssh
|
||||
clear
|
||||
echo -e "\e[1mLogin on ${_LOGIN} | $(uname -r) | $(date)\e[m"
|
||||
echo ""
|
||||
cat /etc/motd
|
||||
|
|
Loading…
Reference in a new issue