Files
ports/sysutils/ttyd/files/ttyd.in
Yuri Victorovich b57b20329b sysutils/ttyd: Add -W flag and /usr/bin/login default program
-W             - flag is needed in order for clients to be able
                 to write into the terminal, otherwise it is read-only
/usr/bin/login - is needed for users to be logged in,
                 because this is what most users expect

PR:		289702
Approved by:	nc@FreeBSD.org (maintainer's timeout; 25 days)
2025-10-14 20:22:52 -07:00

31 lines
809 B
Bash
Executable File

#!/bin/sh
# PROVIDE: ttyd
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# ttyd_enable (bool): Set to NO by default. Set it to YES to enable ttyd.
# ttyd_acct (string): Default user to run ttyd under, "nobody"
# ttyd_exec (string): Default command to run in ttyd, "/bin/sh"
# ttyd_args (string): Extra arguments passed to ttyd.
# Default is "--interface lo0 --port 7681"
. /etc/rc.subr
name=ttyd
rcvar=ttyd_enable
load_rc_config $name
: ${ttyd_enable:="NO"}
: ${ttyd_acct:="nobody"}
: ${ttyd_exec:="/usr/bin/login"}
: ${ttyd_args:="--interface lo0 --port 7681 -W"}
procname="/usr/local/bin/${name}"
command="/usr/sbin/daemon"
command_args="-r -R 15 -f -t ${name} -T ttyd -u ${ttyd_acct} /usr/local/bin/ttyd ${ttyd_args} ${ttyd_exec}"
run_rc_command "$1"