#!/bin/sh # source function library . /etc/rc.d/init.d/functions PROGRAM=button_exec PROGRAM_ARGS="-d /dev/ppb /etc/button_exec.conf" RETVAL=0 case "$1" in start) echo -n "Starting $PROGRAM: " daemon $PROGRAM $PROGRAM_ARGS RETVAL=$? echo ;; stop) echo -n "Stopping $PROGRAM: " killproc $PROGRAM RETVAL=$? echo ;; restart) $0 stop $0 start RETVAL=$? ;; *) echo "Usage: button_exec {start|stop|restart}" exit 1 esac exit $RETVAL