diff options
author | Steve Arnold <nerdboy@gentoo.org> | 2006-01-21 21:24:14 +0000 |
---|---|---|
committer | Steve Arnold <nerdboy@gentoo.org> | 2006-01-21 21:24:14 +0000 |
commit | 0c1ea526399fac8de4acc0bd1475b3e375aee5c5 (patch) | |
tree | 04164ae248dddf0a7b1fa57e0124066ba0ea9160 /sys-apps/kuroevtd/files | |
parent | added patch for 2.6.15 support; small change for libfglrxdrm.so (diff) | |
download | historical-0c1ea526399fac8de4acc0bd1475b3e375aee5c5.tar.gz historical-0c1ea526399fac8de4acc0bd1475b3e375aee5c5.tar.bz2 historical-0c1ea526399fac8de4acc0bd1475b3e375aee5c5.zip |
new ebuild for kurobox power button events
Diffstat (limited to 'sys-apps/kuroevtd/files')
-rw-r--r-- | sys-apps/kuroevtd/files/digest-kuroevtd-1.1.3 | 1 | ||||
-rw-r--r-- | sys-apps/kuroevtd/files/kuroevtd.d/powerdown | 19 | ||||
-rw-r--r-- | sys-apps/kuroevtd/files/kuroevtd.d/powerpress | 8 | ||||
-rw-r--r-- | sys-apps/kuroevtd/files/kuroevtd.d/powerup | 10 | ||||
-rw-r--r-- | sys-apps/kuroevtd/files/kuroevtd.d/resetpress | 12 | ||||
-rw-r--r-- | sys-apps/kuroevtd/files/kuroevtd.initd | 26 |
6 files changed, 76 insertions, 0 deletions
diff --git a/sys-apps/kuroevtd/files/digest-kuroevtd-1.1.3 b/sys-apps/kuroevtd/files/digest-kuroevtd-1.1.3 new file mode 100644 index 000000000000..564f734d6c3b --- /dev/null +++ b/sys-apps/kuroevtd/files/digest-kuroevtd-1.1.3 @@ -0,0 +1 @@ +MD5 6b00820a543ab8729281c158dc322847 kuroevtd_1.1.3.tgz 5575 diff --git a/sys-apps/kuroevtd/files/kuroevtd.d/powerdown b/sys-apps/kuroevtd/files/kuroevtd.d/powerdown new file mode 100644 index 000000000000..8901b077ea11 --- /dev/null +++ b/sys-apps/kuroevtd/files/kuroevtd.d/powerdown @@ -0,0 +1,19 @@ +#!/bin/bash + +STATE_DIR="/var/lib/kuroevtd" +debug=true + +current=$(date +%s) + +if [ -f "${STATE_DIR}/last" ] ; then + read last <<<$(cat "${STATE_DIR}/last") + rm -f ${STATE_DIR}/last + if (( current <= (last+3) )) ; then + ${debug} && echo "[kuroevtd] powerdown: will reset soon..." + touch ${STATE_DIR}/reset + exit 0 + fi +fi + +${debug} && echo "[kuroevtd] powerdown: saving push date" +echo ${current} > "${STATE_DIR}/last" diff --git a/sys-apps/kuroevtd/files/kuroevtd.d/powerpress b/sys-apps/kuroevtd/files/kuroevtd.d/powerpress new file mode 100644 index 000000000000..df842a83fb42 --- /dev/null +++ b/sys-apps/kuroevtd/files/kuroevtd.d/powerpress @@ -0,0 +1,8 @@ +#!/bin/sh + +STATE_DIR="/var/lib/kuroevtd" +debug=true + +${debug} && echo "[kuroevtd] powerpress: shutdown now!" +rm -f ${STATE_DIR}/* +shutdown -h now diff --git a/sys-apps/kuroevtd/files/kuroevtd.d/powerup b/sys-apps/kuroevtd/files/kuroevtd.d/powerup new file mode 100644 index 000000000000..78985218a3d4 --- /dev/null +++ b/sys-apps/kuroevtd/files/kuroevtd.d/powerup @@ -0,0 +1,10 @@ +#!/bin/sh + +STATE_DIR="/var/lib/kuroevtd" +debug=true + +if [ -f "${STATE_DIR}/reset" ] ; then + ${debug} && echo "[kuroevtd] powerup: reset now!" + rm -f ${STATE_DIR}/* + shutdown -r now +fi diff --git a/sys-apps/kuroevtd/files/kuroevtd.d/resetpress b/sys-apps/kuroevtd/files/kuroevtd.d/resetpress new file mode 100644 index 000000000000..56dd3a61a17a --- /dev/null +++ b/sys-apps/kuroevtd/files/kuroevtd.d/resetpress @@ -0,0 +1,12 @@ +#!/bin/bash + +STATE_DIR="/var/lib/kuroevtd" +debug=true + +${debug} && echo "[kuroevtd] powerpress: reset in EM mode now!" +if grep -q started <<<$(/etc/init.d/em-fallback status 2>/dev/null) ; then + /etc/init.d/em-fallback stop +fi +rm -f ${STATE_DIR}/* +write_ng +shutdown -r now diff --git a/sys-apps/kuroevtd/files/kuroevtd.initd b/sys-apps/kuroevtd/files/kuroevtd.initd new file mode 100644 index 000000000000..89216bd745b4 --- /dev/null +++ b/sys-apps/kuroevtd/files/kuroevtd.initd @@ -0,0 +1,26 @@ +#!/sbin/runscript + +[ -z "${PIDFILE}" ] && PIDFILE=/var/run/kuroevtd.pid + +depend() { + need kuro-avr-init +} + +start() { + ebegin "Starting Kurobox button events monitor" + start-stop-daemon --start --quiet --exec /usr/sbin/kuroevtd \ + || eend 1 \ + || return 1 + local mypid=$(pidof /usr/sbin/kuroevtd 2>/dev/null) + [ -n "${mypid}" ] && echo ${mypid} > ${PIDFILE} + eend 0 +} + +stop() { + ebegin "Stopping Kurobox button events monitor" + start-stop-daemon --stop --quiet --pidfile=${PIDFILE} + local status=$? + rm -f ${PIDFILE} + eend $status +} + |