#!/bin/sh # $FreeBSD$ # # PROVIDE: redportsnode # REQUIRE: DAEMON # BEFORE: LOGIN # KEYWORD: shutdown # # Add the following line to /etc/rc.conf[.local] to enable redportsnode # # redportsnode_enable (bool): Set to "NO" by default. # Set it to "YES" to enable redportsnode. . /etc/rc.subr name=redportsnode rcvar=redportsnode_enable command="%%LOCALBASE%%/bin/redports-node" command_interpreter="php" pidfile="/var/run/${name}.pid" start_cmd="${name}_start" redportsnode_start() { local pid pid=$(check_pidfile $pidfile $command) if [ -n "${pid}" ]; then echo "${name} already running? (pid=${pid})." return 1 fi echo -n "Starting ${name}" /usr/sbin/daemon -f -p ${pidfile} ${command} echo '.' } load_rc_config $name : ${redportsnode_enable="NO"} run_rc_command "$1"