Skip to content

Instantly share code, notes, and snippets.

@koichirok
Last active June 14, 2019 13:46
Show Gist options
  • Save koichirok/c06d060a7c6413bd7ed258fd48a68941 to your computer and use it in GitHub Desktop.
Save koichirok/c06d060a7c6413bd7ed258fd48a68941 to your computer and use it in GitHub Desktop.
FreeBSD rc script for wetty (https://github.com/krishnasrinivas/wetty)
#!/bin/sh
#
# $FreeBSD: $
#
# PROVIDE: wetty
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
# Add the following to /etc/rc.conf[.local] to enable this service
#
# wetty_enable="YES"
#
. /etc/rc.subr
name="wetty"
rcvar="wetty_enable"
load_rc_config ${name}
: ${wetty_enable=NO}
pidfile=/var/run/wetty.pid
command="/usr/local/bin/wetty"
command_interpreter="/usr/local/bin/node"
start_cmd="${name}_start"
wetty_start()
{
echo -n "Starting ${name}."
/usr/sbin/daemon -p ${pidfile} ${command_interpreter} ${command}
}
run_rc_command "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment