mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
use screen on ssh connection, rename ttyd.sh to remote-login.sh
This commit is contained in:
parent
2f9b2f4293
commit
01e87254e8
4 changed files with 10 additions and 5 deletions
|
@ -33,7 +33,7 @@ build ()
|
||||||
add_symlink /etc/systemd/system/multi-user.target.wants/sshd.service /usr/lib/systemd/system/sshd.service
|
add_symlink /etc/systemd/system/multi-user.target.wants/sshd.service /usr/lib/systemd/system/sshd.service
|
||||||
# start ttyd on startup
|
# start ttyd on startup
|
||||||
add_file /usr/lib/libwebsockets-evlib_uv.so
|
add_file /usr/lib/libwebsockets-evlib_uv.so
|
||||||
add_file /usr/share/archboot/remote/usr/bin/ttyd.sh /usr/bin/ttyd.sh
|
add_file /usr/share/archboot/remote/usr/bin/remote-login.sh /usr/bin/remote-login.sh
|
||||||
add_file /usr/share/archboot/remote/etc/systemd/system/ttyd.service /etc/systemd/system/ttyd.service
|
add_file /usr/share/archboot/remote/etc/systemd/system/ttyd.service /etc/systemd/system/ttyd.service
|
||||||
add_symlink /etc/systemd/system/multi-user.target.wants/ttyd.service /etc/systemd/system/ttyd.service
|
add_symlink /etc/systemd/system/multi-user.target.wants/ttyd.service /etc/systemd/system/ttyd.service
|
||||||
# fix licenses
|
# fix licenses
|
||||||
|
|
|
@ -25,3 +25,8 @@ fi
|
||||||
if [[ -z "${TTY}" && -z "${SSH_TTY}" ]]; then
|
if [[ -z "${TTY}" && -z "${SSH_TTY}" ]]; then
|
||||||
[[ "${SHLVL}" == "2" ]] && cat /etc/motd
|
[[ "${SHLVL}" == "2" ]] && cat /etc/motd
|
||||||
fi
|
fi
|
||||||
|
# run remote-login.sh on ssh connection
|
||||||
|
if [[ -z "${STY}" && -n "${SSH_TTY}" ]]; then
|
||||||
|
/usr/bin/remote-login.sh
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
|
@ -7,7 +7,7 @@ After=syslog.target
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/ttyd ttyd.sh
|
ExecStart=/usr/bin/ttyd remote-login.sh
|
||||||
Type=simple
|
Type=simple
|
||||||
Restart=always
|
Restart=always
|
||||||
User=root
|
User=root
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
# SPDX-License-Identifier: GPL-2.0-only
|
# SPDX-License-Identifier: GPL-2.0-only
|
||||||
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
# Created by Tobias Powalowski <tpowa@archlinux.org>
|
||||||
|
|
||||||
# simulate login from tty
|
# simulate login from tty on first screen session
|
||||||
if ! [[ -e /tmp/.setup-running ]]; then
|
if ! screen -ls &>/dev/null; then
|
||||||
cat /etc/motd
|
cat /etc/motd
|
||||||
echo -e "Hit \e[1m\e[92mENTER\e[m for \e[1mshell\e[m login."
|
echo -e "Hit \e[1m\e[92mENTER\e[m for \e[1mshell\e[m login."
|
||||||
read -r
|
read -r
|
||||||
fi
|
fi
|
||||||
. /etc/profile
|
. /etc/profile
|
||||||
screen -q -R
|
screen -q -xRR
|
Loading…
Reference in a new issue