Skip to content
Snippets Groups Projects
Commit 88728c9f authored by deuce's avatar deuce
Browse files

Replace the4 old and apparently broken rc.d script with the one I've been

running on my FreeBSD box for years.
parent cc9b35da
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# PROVIDE: sbbs
# REQUIRE: login
# PROVIDE sbbs
# REQUIRE LOGIN
. /etc/rc.subr
# Location of rc.subr
if [ `/usr/bin/uname -r | /usr/bin/sed 's/[^0-9].*//g'` -lt 5 ]
then
rc_subr_path="/usr/local/etc/rc.subr"
else
rc_subr_path="/etc/rc.subr"
fi
if [ ! -f ${rc_subr_path} ]
then
echo "${rc_subr_path} not found" >> /dev/stderr
if [ `/usr/bin/uname -r | /usr/bin/sed 's/[^0-9].*//g'` -lt 5 ]
echo "Please install the sysutils/rc_subr port" >> /dev/stderr
exit 1
fi
. ${rc_subr_path}
status_cmd=sbbs_status
name="sbbs"
name=sbbs
rcvar=`set_rcvar`
load_rc_config $name
load_rc_config ${name}
# Setup defaults...
# Define these sbbs_* variables in one of these files:
......@@ -36,28 +17,43 @@ load_rc_config $name
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
sbbs=${sbbs-"NO"}
sbbs_enable=${sbbs_enable-"NO"}
sbbs_flags=${sbbs_flags-""}
sbbs_pidfile=${sbbs_pidfile-"/var/run/sbbs.pid"}
sbbs_dir=${sbbs_dir-"/sbbs/"}
sbbs_ctrldir=${sbbs_ctrldir-"${sbbs_dir}/ctrl/"}
sbbs_execdir=${sbbs_execdir-"${sbbs_dir}/exec/"}
sbbs_dir=${sbbs_dir-"/sbbs"}
sbbs_ctrldir=${sbbs_ctrldir-"${sbbs_dir}/ctrl"}
sbbs_execdir=${sbbs_execdir-"${sbbs_dir}/exec"}
sbbs_program=${sbbs_program-"${sbbs_execdir}/sbbs"}
sbbs_procname=${sbbs_procname-"${sbbs_program}"}
sbbs_procname=${sbbs_procname-"${sbbs_execdir}/sbbs"}
sbbs_shell=${sbbs_shell-"/bin/sh"}
sbbs_status()
status_cmd=sbbs_node
start_precmd=sbbs_env
command=${sbbs_program}
pidfile=${sbbs_pidfile}
sbbs_node()
{
${sbbs_execdir}/node list
echo
if [ -n "$rc_pid" ]; then
echo "${name} is running as pid $rc_pid."
else
echo "${name} is not running."
return 1
fi
if [ -n "$rc_pid" ]; then
echo "${name} is running as pid $rc_pid."
else
echo "${name} is not running."
return 1
fi
}
sbbs_env()
{
SHELL=$sbbs_shell
export SHELL
SBBSCTRL=$sbbs_ctrldir
export SBBSCTRL
PATH=/bin:/usr/bin:/usr/games:/usr/local/bin
export PATH
}
extra_commands="config monitor uedit"
......@@ -65,8 +61,4 @@ config_cmd=${sbbs_execdir}/scfg
monitor_cmd=${sbbs_execdir}/umonitor
uedit_cmd=${sbbs_execdir}/uedit
SHELL=$sbbs_shell
export SHELL
SBBSCTRL=$sbbs_ctrldir
export SBBSCTRL
run_rc_command "$1"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment