nino:~# /usr/local/bin/kernelmon_exec.sh: line 16: syntax error near unexpected token `fi' /usr/local/bin/kernelmon_exec.sh: line 16: `fi'だはは。バグってる。
     14 if [ -f /etc/melco/info ]; then
     15         #. /etc/melco/info
     16 fi
     17
この if 文、空。
kernelmon_exec.sh は、標準ファームの kernelmon_exec.sh に
 LS-GL_hackkit_2.00.sh で sed をかけたもの。
標準ファームの kernelmon_exec.sh に変更があって、
それに sed スクリプトが追従できていない。
やっぱ、標準ファームに依存し、追従の必要ある形はあかんな。
nino:~# cd /usr/local/bin
nino:/usr/local/bin# mv kernelmon_exec.sh kernelmon_exec.sh.orig
nino:/usr/local/bin# cp kernelmon_exec.sh.orig kernelmon_exec.sh
nino:/usr/local/bin# ls -l kernelmon_exec.sh*
-rwxr-xr-x 1 root staff 1889 Dec 13 23:16 kernelmon_exec.sh
-rwxr-xr-x 1 root staff 1889 Dec 13 04:52 kernelmon_exec.sh.orig
nino:/usr/local/bin# vi kernelmon_exec.sh
	:
	:
nino:/usr/local/bin# diff -c kernelmon_exec.sh.orig kernelmon_exec.sh
*** kernelmon_exec.sh.orig      Thu Dec 13 04:52:22 2007
--- kernelmon_exec.sh   Thu Dec 13 23:16:45 2007
***************
*** 12,18 ****
        . /etc/melco/email
  fi
  if [ -f /etc/melco/info ]; then
!       #. /etc/melco/info
  fi
  LOGTAG=kernelmon
--- 12,18 ----
        . /etc/melco/email
  fi
  if [ -f /etc/melco/info ]; then
!       . /etc/melco/info
  fi
  LOGTAG=kernelmon
nino:/usr/local/bin#
電源ボタンを押してみた、、、、何もおこらない。
shutdown -h now でシャットダウンして再起動、
電源ボタンを押してみたら、今度は、
/usr/local/bin/kernelmon_exec.sh: line 80: -a: command not found MIntActが延々と表示された。
/usr/local/bin/kernelmon_exec.sh の 80 行目は、
     79 micon_interrupts)
     80         int=`$MICONAPL -a int_get_switch_status |grep "int=" |sed -e "s/int=//"`
     81         ##echo "miconint = ($int)"  >/dev/console
MICONAPL が未定義か。
というわけで、一から作った方が早そう。
nino:~# cat /usr/local/bin/kernelmon_exec.sh
#!/bin/sh
if [ "$1" != micon_interrupts ]
then
        exit
fi
int=`/usr/local/sbin/miconapl -a int_get_switch_status | sed -n -e 's/^int=\(.*\)$/\1/p'`
if [ "$int" = power_sw ]
then
        shutdown -h now
fi
nino:~#
さて、ハックキット作り直しか。。。。。
| 
 | 
| ← 新型 LS-GL にハックキット(3)最初の設定 | ハックの記録 LinkStation/玄箱 をハックしよう | → LS-GL/HS-DHGL ハックキットの作り直し |