overlay/sys-apps/micro-evtd/files/micro-evtd-boot.initd
2011-12-21 21:39:54 +01:00

55 lines
1.3 KiB
Plaintext

#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
description="Linkstation/Kurobox/Terastation micro controller daemon"
depend() {
need localmount
use logger
}
start() {
# micro_evtd doesn't start properly from s-s-d, need to investigate
ebegin "Starting ${description}"
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
head -n1 | sed "s/^[^:]*: //")
case $device in
"Buffalo Linkstation Pro/Live" | "Buffalo/Revogear Kurobox Pro")
deamon=micro-evtd.pro
ln -sf $deamon /usr/sbin/micro-evtd
;;
"Buffalo TeraStation Pro/Live" )
deamon=micro-evtd.tera
ln -sf $deamon /usr/sbin/micro-evtd
;;
*)
eerror "micro-evtd error: device is not supported"
;;
esac
#start-stop-daemon --start --exec /usr/sbin/micro-evtd
/usr/sbin/$deamon
eend $?
}
stop() {
ebegin "Stopping ${description}"
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
head -n1 | sed "s/^[^:]*: //")
case $device in
"Buffalo Linkstation Pro/Live" | "Buffalo/Revogear Kurobox Pro")
deamon=micro-evtd.pro
;;
"Buffalo TeraStation Pro/Live" )
deamon=micro-evtd.tera
;;
*)
eerror "micro-evtd error: device is not supported"
;;
esac
start-stop-daemon --stop --exec /usr/sbin/$deamon
eend $?
}