#!/bin/sh # Start/stop/restart the IPFM Daemon (ipfm) # Written for Slackware Linux by Erik Jan Tromp ipfm_start() { if [ -x /usr/sbin/ipfm -a -f /etc/ipfm.conf ]; then echo "Starting ipfm: /usr/sbin/ipfm" cd / && /usr/sbin/ipfm fi } ipfm_stop() { if [ -r /var/run/ipfm.pid ] ; then kill $(cat /var/run/ipfm.pid) else killall ipfm fi } ipfm_restart() { ipfm_stop sleep 1 ipfm_start } case "$1" in 'start') ipfm_start ;; 'stop') ipfm_stop ;; 'restart') ipfm_restart ;; *) echo "usage: $0 start|stop|restart" esac