0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-12-16 03:19:04 +00:00
mglae 26d1839cb6 service.ttyd: start script and service fix and improvements
- -W is required since 1.7.4 to disable ttyd read only mode
- one level log history
- simpify ExecStart
- slightly increment timeouts
2024-03-18 19:30:48 +01:00

20 lines
548 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.ttyd
LD_LIBRARY_PATH=$ADDON_DIR/lib.private:$LD_LIBRARY_PATH
if [ "$TTYD_NOLOGIN" = "true" ]; then
TTYD_NOLOGIN="bash"
elif [ "$TTYD_NOLOGIN" = "false" ]; then
TTYD_NOLOGIN="login root"
fi
[ -f "$ADDON_HOME/service.log" ] && mv -f "$ADDON_HOME/service.log" "$ADDON_HOME/service.old.log"
exec $ADDON_DIR/bin/ttyd -W -O -T xterm -p ${TTYD_WEBPORT} ${TTYD_NOLOGIN} &>$ADDON_HOME/service.log