#!/bin/sh # $Id$ . /etc/rc.subr . /etc/rc.conf COLS=`tput cols` eval "_ENABLE=\${${NAME}_enable}" ENABLE="`echo $_ENABLE | tr "[:upper:]" "[:lower:]"`" . /dev/stdin << EOF ${NAME}_start(){ if [ "${ENABLE}" = "no" ]; then return 0 elif [ "${ENABLE}" != "yes" ]; then printf "\r\x1b[2K${NAME} is not configured properly ; write ${NAME}_enable=YES in /etc/rc.conf\n" return 1 fi printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[31m....\x1b[m\x1b[1m]\x1b[m\r" _${NAME}_start if [ "\$?" = "0" ]; then printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[33m OK \x1b[m\x1b[1m]\x1b[m" else printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[31mFAIL\x1b[m\x1b[1m]\x1b[m" fi echo } EOF . /dev/stdin << EOF ${NAME}_stop(){ if [ "${ENABLE}" != "no" ]; then return 0 elif [ "${ENABLE}" != "yes" ]; then printf "\r\x1b[2K${NAME} is not configured properly ; write ${NAME}_enable=YES in /etc/rc.conf\n" return 1 fi printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[31m....\x1b[m\x1b[1m]\x1b[m\r" _${NAME}_stop if [ "\$?" = "0" ]; then printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[33m OK \x1b[m\x1b[1m]\x1b[m" else printf "\r\x1b[`expr $COLS - 5`G\x1b[1m[\x1b[31mFAIL\x1b[m\x1b[1m]\x1b[m" fi echo } EOF if [ "$1" = "start" ]; then ${NAME}_start elif [ "$1" = "stop" ]; then ${NAME}_stop else echo $0 \[ start \| stop \] exit 0 fi