#!/bin/sh # check_fxo_bug2.sh # David Rowe 19/10/09 # # Checks FXO port for bug #2 - port doesn't look up but # registers indicate that the line side has gone into # power down mode PATH=/sbin:/bin:/usr/sbin:/usr/bin # Set CARDS to the FXO modules in the system # e.g. if Port 1 and 2 are FXO: # CARDS="0 1" # if Ports 1 and 4 are FXO: # CARDS="0 3" CARDS="0 1" while [ 1 ] do for i in $CARDS do echo $i > /proc/wcfxs/card echo 6 > /proc/wcfxs/regaddr echo $i cat /proc/wcfxs/value if grep 0x10 /proc/wcfxs/value > /dev/null then # FXO module bug 2 detected! date >> /root/check_fxo_bug2.log echo "module $i" >> /root/check_fxo_bug2.log # send wcfxs driver command to re-initialise echo 1 > /proc/wcfxs/init_fxo fi done sleep 5 done