summaryrefslogtreecommitdiff
path: root/mail/drac/files/dracd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'mail/drac/files/dracd.sh')
-rw-r--r--mail/drac/files/dracd.sh24
1 files changed, 19 insertions, 5 deletions
diff --git a/mail/drac/files/dracd.sh b/mail/drac/files/dracd.sh
index 902ccdf7ae9c..0490ac2f9114 100644
--- a/mail/drac/files/dracd.sh
+++ b/mail/drac/files/dracd.sh
@@ -1,16 +1,30 @@
#!/bin/sh
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
+if ! PREFIX=$(/bin/expr $0 : "\(/.*\)/etc/rc\.d/${0##*/}\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 64
+fi
+
+if [ -r /etc/defaults/rc.conf ]; then
+ . /etc/defaults/rc.conf
+ source_rc_confs
+elif [ -r /etc/rc.conf ]; then
+ . /etc/rc.conf
fi
case "$1" in
start)
- [ -x ${PREFIX}/sbin/rpc.dracd ] && ${PREFIX}/sbin/rpc.dracd && echo -n ' dracd'
+ case ${dracd_enable:-NO} in
+ [Yy][Ee][Ss])
+ ${dracd_program:-${PREFIX}/sbin/rpc.dracd} ${drac_flags} && echo -n ' dracd'
+ ;;
+ esac
;;
stop)
- killall rpc.dracd >/dev/null 2>&1 && echo -n ' dracd'
+ case ${dracd_enable:-NO} in
+ [Yy][Ee][Ss])
+ /usr/bin/killall rpc.dracd >/dev/null 2>&1 && echo -n ' dracd'
+ esac
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2