KURO-NAS-T4:~# ls /proc/buffalo/kernevnt ls: cannot access /proc/buffalo/kernevnt: No such file or directory KURO-NAS-T4:~# ls /proc/buffalo/ firmware micon miconint_en KURO-NAS-T4:~#ない。
いったいどう通知されるんだ?
まずは押さない状態
KURO-NAS-T4:~# /usr/local/sbin/miconapl -a int_get_switch_status #[miconapl.int_get_switch_status] int=unknown KURO-NAS-T4:~#電源スイッチを押してからもう一度
KURO-NAS-T4:~# /usr/local/sbin/miconapl -a int_get_switch_status #[miconapl.int_get_switch_status] int=unknown KURO-NAS-T4:~#一緒。もう少し長押ししてもう一度。
KURO-NAS-T4:~# /usr/local/sbin/miconapl -a int_get_switch_status #[miconapl.int_get_switch_status] int=unknown KURO-NAS-T4:~#取れないのか???
押しながら実行。
KURO-NAS-T4:~# /usr/local/sbin/miconapl -a int_get_switch_status #[miconapl.int_get_switch_status] int=power_sw KURO-NAS-T4:~#取れた。
KURO-NAS-T4:~# vi /usr/local/sbin/kernelmon
:
:
KURO-NAS-T4:~# cat !$
cat /usr/local/sbin/kernelmon
#!/bin/sh
while :
do
case `/usr/local/sbin/miconapl -a int_get_switch_status | sed -n -e 's/int=//p'` in
power_sw)
shutdown -h now
;;
*)
sleep 1
;;
esac
done
KURO-NAS-T4:~#
1秒に1回実行では、たまらんか???
実行する。
KURO-NAS-T4:~# uptime 06:16:29 up 22 min, 1 user, load average: 0.03, 0.01, 0.00 KURO-NAS-T4:~# sh /usr/local/sbin/kernelmon & [1] 2281 KURO-NAS-T4:~# uptime 06:16:47 up 22 min, 1 user, load average: 0.02, 0.01, 0.00 KURO-NAS-T4:~#負荷はそれほどでもなさそう。
無事 shutdown が走った。
あとは起動時に実行するぐらい。
|
|
← fan control |
ハックの記録 LinkStation/玄箱 をハックしよう |
→ まとめ |