From 7407396445cca3c3b2b363e3bb905c233553b9ff Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 23 Nov 2017 23:27:16 +0100 Subject: [PATCH] - skel-root/cst: move shutdown_helper call to own init script ... and call it at end of rcK --- .../coolstream/hd1/etc/init.d/custom-poweroff | 20 +++++++++++++++++++ skel-root/coolstream/hd1/etc/init.d/rcK | 3 +++ .../coolstream/hd1/etc/init.d/start_neutrino | 11 ---------- .../coolstream/hd2/etc/init.d/custom-poweroff | 20 +++++++++++++++++++ skel-root/coolstream/hd2/etc/init.d/rcK | 3 +++ .../coolstream/hd2/etc/init.d/start_neutrino | 11 ---------- 6 files changed, 46 insertions(+), 22 deletions(-) create mode 100755 skel-root/coolstream/hd1/etc/init.d/custom-poweroff create mode 100755 skel-root/coolstream/hd2/etc/init.d/custom-poweroff diff --git a/skel-root/coolstream/hd1/etc/init.d/custom-poweroff b/skel-root/coolstream/hd1/etc/init.d/custom-poweroff new file mode 100755 index 00000000..59e458bc --- /dev/null +++ b/skel-root/coolstream/hd1/etc/init.d/custom-poweroff @@ -0,0 +1,20 @@ +#!/bin/sh + +. /etc/init.d/globals + +case $1 in + stop) + TIMER="/tmp/.timer" + test -e $TIMER || exit 0 + + if type shutdown_helper > /dev/null; then + # send current time, wakeup time, led and bright settings to frontpanel + PARAM=`cat $TIMER` + SHOWINFO "calling 'shutdown_helper "$PARAM"'" + shutdown_helper $PARAM + fi + ;; + *) + echo "[$BASENAME] Usage: $0 {stop}" + ;; +esac diff --git a/skel-root/coolstream/hd1/etc/init.d/rcK b/skel-root/coolstream/hd1/etc/init.d/rcK index e7338005..539e67f0 100755 --- a/skel-root/coolstream/hd1/etc/init.d/rcK +++ b/skel-root/coolstream/hd1/etc/init.d/rcK @@ -23,3 +23,6 @@ LOGINFO "run initscripts stop ..." run_initscripts stop SHOWINFO "done" + +# send current time, wakeup time, led and bright settings to frontpanel +service custom-poweroff stop diff --git a/skel-root/coolstream/hd1/etc/init.d/start_neutrino b/skel-root/coolstream/hd1/etc/init.d/start_neutrino index fd366883..1d811902 100755 --- a/skel-root/coolstream/hd1/etc/init.d/start_neutrino +++ b/skel-root/coolstream/hd1/etc/init.d/start_neutrino @@ -12,17 +12,6 @@ do_cleanup() { do_shutdown() { dt -t"SHUTDOWN" - - TIMER="/tmp/.timer" - if [ -e $TIMER ]; then - # send timers, led and bright settings to frontpanel - if type shutdown_helper > /dev/null; then - PARAM=`cat $TIMER` - echo "calling 'shutdown_helper "$PARAM"'" - shutdown_helper $PARAM - fi - fi - poweroff } diff --git a/skel-root/coolstream/hd2/etc/init.d/custom-poweroff b/skel-root/coolstream/hd2/etc/init.d/custom-poweroff new file mode 100755 index 00000000..59e458bc --- /dev/null +++ b/skel-root/coolstream/hd2/etc/init.d/custom-poweroff @@ -0,0 +1,20 @@ +#!/bin/sh + +. /etc/init.d/globals + +case $1 in + stop) + TIMER="/tmp/.timer" + test -e $TIMER || exit 0 + + if type shutdown_helper > /dev/null; then + # send current time, wakeup time, led and bright settings to frontpanel + PARAM=`cat $TIMER` + SHOWINFO "calling 'shutdown_helper "$PARAM"'" + shutdown_helper $PARAM + fi + ;; + *) + echo "[$BASENAME] Usage: $0 {stop}" + ;; +esac diff --git a/skel-root/coolstream/hd2/etc/init.d/rcK b/skel-root/coolstream/hd2/etc/init.d/rcK index e7338005..539e67f0 100755 --- a/skel-root/coolstream/hd2/etc/init.d/rcK +++ b/skel-root/coolstream/hd2/etc/init.d/rcK @@ -23,3 +23,6 @@ LOGINFO "run initscripts stop ..." run_initscripts stop SHOWINFO "done" + +# send current time, wakeup time, led and bright settings to frontpanel +service custom-poweroff stop diff --git a/skel-root/coolstream/hd2/etc/init.d/start_neutrino b/skel-root/coolstream/hd2/etc/init.d/start_neutrino index 8a174fd8..2fb80e19 100755 --- a/skel-root/coolstream/hd2/etc/init.d/start_neutrino +++ b/skel-root/coolstream/hd2/etc/init.d/start_neutrino @@ -16,17 +16,6 @@ do_cleanup() { do_shutdown() { dt -t"SHUTDOWN" - - TIMER="/tmp/.timer" - if [ -e $TIMER ]; then - # send timers, led and bright settings to frontpanel - if type shutdown_helper > /dev/null; then - PARAM=`cat $TIMER` - echo "calling 'shutdown_helper "$PARAM"'" - shutdown_helper $PARAM - fi - fi - poweroff }