|
Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
| 2 |
|
| 3 |
# $FreeBSD$ |
| 4 |
# |
| 5 |
# PROVIDE: sshout |
| 6 |
# REQUIRE: LOGIN |
| 7 |
# KEYWORD: shutdown |
| 8 |
# |
| 9 |
# To enable this service, add |
| 10 |
# sshout_enable="<bool>" # Set to NO by default. |
| 11 |
# # Set it to YES to enable sshout. |
| 12 |
# into /etc/rc.conf.local or /etc/rc.conf |
| 13 |
|
| 14 |
. /etc/rc.subr |
| 15 |
|
| 16 |
name=sshout |
| 17 |
rcvar=sshout_enable |
| 18 |
|
| 19 |
load_rc_config $name |
| 20 |
|
| 21 |
: ${sshout_enable:="NO"} |
| 22 |
|
| 23 |
sshout_user=sshout |
| 24 |
sshout_home="`getent passwd sshout | cut -d : -f 6`" |
| 25 |
[ -z "$sshout_home" ] && exit 1 |
| 26 |
sshout_env="HOME=$sshout_home" |
| 27 |
sshout_chdir="$sshout_home" |
| 28 |
procname=%%PREFIX%%/libexec/sshoutd |
| 29 |
pidfile="$sshout_home/sshoutd.pid" |
| 30 |
command=/usr/sbin/daemon |
| 31 |
command_args="-f $procname" |
| 32 |
stop_postcmd="rm -f $pidfile" |
| 33 |
|
| 34 |
run_rc_command "$1" |