#!/bin/sh # # $FreeBSD: head/games/automuteus/files/automuteus.in 561740 2021-01-16 17:17:59Z nc $ # # PROVIDE: automuteus # REQUIRE: DAEMON FILESYSTEMS NETWORKING # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable automuteus. # #automuteus_enable="YES" . /etc/rc.subr name="automuteus" rcvar="automuteus_enable" load_rc_config $name : ${automuteus_enable:="NO"} : ${automuteus_conf:="%%PREFIX%%/etc/automuteus/config.txt"} : ${automuteus_log:="/var/log/automuteus"} command="%%PREFIX%%/bin/automuteus" pidfile=/var/run/${name}.pid start_cmd="automuteus_start" stop_cmd="automuteus_stop" automuteus_start() { check_startmsgs && echo "Starting ${name}." /usr/sbin/daemon \ -p ${pidfile} \ /usr/bin/env \ "CONFIG_PATH=${automuteus_conf}" \ "LOG_PATH=${automuteus_log}" \ ${command} } automuteus_stop() { kill `cat ${pidfile}` } run_rc_command "$1"