Replace screen with tmux for monitoring setup

This commit is contained in:
Christian Krakau-Louis
2025-09-07 15:45:22 +02:00
committed by GitHub
parent 3c91aeeaaa
commit 8d7fcd285f
+13 -13
View File
@@ -25,21 +25,21 @@ NC='\033[0m'
log() { echo -e "$@"; } log() { echo -e "$@"; }
# ============================================================ # ============================================================
# Monitoring setup (screen + htop + iftop + logs) # Monitoring setup (tmux split screen)
# ============================================================ # ============================================================
if [ -z "${INSIDE_SCREEN:-}" ]; then if [ -z "${INSIDE_TMUX:-}" ]; then
apt-get update -y apt-get update -y
apt-get install -y screen htop iftop apt-get install -y tmux htop iftop
export INSIDE_SCREEN=1 export INSIDE_TMUX=1
screen -dmS guac-install bash -c "
screen -t installer bash -c \"INSIDE_SCREEN=1 $(realpath $0) $@\" SCRIPT_CMD="INSIDE_TMUX=1 $(realpath $0) $@"
screen -t htop htop
screen -t iftop iftop -i \$(ip -o -4 route show to default | awk '{print \$5}' | head -n1) tmux new-session -d -s guac-install "echo '>>> Running: $SCRIPT_CMD'; sleep 3; $SCRIPT_CMD"
screen -t logs tail -f /var/log/syslog tmux split-window -h "htop"
exec bash tmux split-window -v -t 0 "iftop -i \$(ip -o -4 route show to default | awk '{print \$5}' | head -n1)"
" tmux split-window -v -t 1 "tail -f /var/log/syslog"
echo -e \"${GREEN}Monitoring session started in screen 'guac-install'.${NC}\" tmux select-layout tiled
echo -e \"Use: screen -r guac-install to attach.${NC}\" tmux attach -t guac-install
exit 0 exit 0
fi fi