#!/bin/sh # /etc/rc.d/rc.apmd # # Start/stop/restart apmd # modified for colorized screen messages and local needs source /etc/functions-colors # Start apmd apmd_start() { if [ ! -e /proc/apm ]; then /sbin/modprobe apm fi if [ -x /usr/sbin/apmd ]; then echo -e "${BOLDWHITE}Starting the APM daemon:${COLOR_RESET}" echo "/usr/sbin/apmd" /usr/sbin/apmd fi } # Stop apmd apmd_stop() { echo -e "${BOLDWHITE}Stopping the APM daemon.${COLOR_RESET}" killall apmd } # Restart apmd apmd_restart() { apmd_stop sleep 1 apmd_start } case "$1" in 'start') apmd_start ;; 'stop') apmd_stop ;; 'restart') apmd_restart ;; *) echo -e "${BOLDRED}Usage:${COLOR_RESET} $0 start|stop|restart" exit 1 esac