mirror of
https://anongit.gentoo.org/git/repo/gentoo.git
synced 2025-12-13 05:30:50 +00:00
37 lines
1 KiB
Text
37 lines
1 KiB
Text
#!/sbin/openrc-run
|
|
# Copyright 1999-2021 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
description="Serial to network proxy (${RC_SVCNAME#*.})"
|
|
pidfile="/var/run/${RC_SVCNAME}.pid"
|
|
command="/usr/sbin/ser2net"
|
|
name="${description}"
|
|
|
|
extra_started_commands="reload"
|
|
description_reload="Reread configuration file and make the appropriate changes"
|
|
start_stop_daemon_args="--quiet"
|
|
command_args_background="-P ${pidfile}"
|
|
command_args_foreground="-n"
|
|
|
|
depend() {
|
|
use logger
|
|
need net
|
|
}
|
|
|
|
start_pre() {
|
|
command_args="${EXTRA_OPTS}"
|
|
CONFIG_FILE_DEFAULT="/etc/ser2net/ser2net.yaml"
|
|
|
|
yesno "${UUCP_LOCKS:-yes}" || command_args="${command_args} -u"
|
|
[ -n "${CONTROL_PORT}" ] && command_args="${command_args} -p ${CONTROL_PORT}"
|
|
[ -z "${CONFIG_FILE}" ] && CONFIG_FILE="${CONFIG_FILE_DEFAULT}"
|
|
[ "${CONFIG_FILE}" != "${CONFIG_FILE_DEFAULT}" ] && command_args="${command_args} -c ${CONFIG_FILE}"
|
|
|
|
return 0
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading ${description}"
|
|
start-stop-daemon --signal HUP --pidfile "${pidfile}"
|
|
eend ${?}
|
|
}
|