Turn low_bat_chack and system_stats into services
This commit is contained in:
parent
4edc9abae2
commit
4505c7a8f4
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start/stop low_bat_check
|
||||
#
|
||||
|
||||
DAEMON=/usr/local/sbin/low_bat_check
|
||||
PIDFILE=/var/run/low_bat_check.pid
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting low_bat_check: "
|
||||
start-stop-daemon -S -x ${DAEMON} -p ${PIDFILE} -m -b -- > /dev/null 2>&1
|
||||
if [ ${?} -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "ERROR"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping low_bat_check: "
|
||||
start-stop-daemon -K -x ${DAEMON} -p ${PIDFILE} -o > /dev/null 2>&1
|
||||
if [ ${?} -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "ERROR"
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1 # Prevent race condition: ensure low_bat_check stops before start.
|
||||
${0} start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Start/stop system_stats
|
||||
#
|
||||
|
||||
DAEMON=/usr/local/sbin/system_stats
|
||||
PIDFILE=/var/run/system_stats.pid
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting system_stats: "
|
||||
start-stop-daemon -S -x ${DAEMON} -p ${PIDFILE} -m -b -- > /dev/null 2>&1
|
||||
if [ ${?} -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "ERROR"
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping system_stats: "
|
||||
start-stop-daemon -K -x ${DAEMON} -p ${PIDFILE} -o > /dev/null 2>&1
|
||||
if [ ${?} -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "ERROR"
|
||||
fi
|
||||
;;
|
||||
restart)
|
||||
${0} stop
|
||||
sleep 1 # Prevent race condition: ensure system_stats stops before start.
|
||||
${0} start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: ${0} {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
|
@ -15,10 +15,4 @@
|
|||
#notif_set 0 "upgrade"
|
||||
#upgrade_fk_incremental
|
||||
|
||||
# Low bat check #
|
||||
low_bat_check >/dev/null 2>&1 &
|
||||
|
||||
# System stats #
|
||||
system_stats >/dev/null 2>&1 &
|
||||
|
||||
exit 0
|
||||
|
|
Loading…
Reference in New Issue