Skip to content

Commit

Permalink
added lockkey for debug scan
Browse files Browse the repository at this point in the history
  • Loading branch information
shmick committed Apr 9, 2015
1 parent b6e6523 commit 9cd774a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions channel_scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,12 @@ do
;;
D)
DEBUG="y"
LOCKKEY="12121212"
OUTFILTER="seq 100"
;;
A)
DEBUG="y"
LOCKKEY="12121212"
OUTFILTER="."
;;
:)
Expand Down Expand Up @@ -205,18 +207,25 @@ GetDebugData () {
# store the results in $ScanResults

echo -e "\nBeginning scan on $ScanDev, tuner $ScanTuner at $(date '+%D %T')\n"
echo -e "Locking $ScanDev, tuner $ScanTuner with key $LOCKKEY\n"
$HDHRConfig $ScanDev set /tuner$ScanTuner/lockkey $LOCKKEY
ScanResults=$(for CHANNEL in {2..51}
do \
$HDHRConfig $ScanDev set /tuner$ScanTuner/channel auto:$CHANNEL
sleep 1
do
$HDHRConfig $ScanDev key $LOCKKEY set /tuner$ScanTuner/channel auto:$CHANNEL
sleep 1
RESULTS=$($HDHRConfig $ScanDev get /tuner$ScanTuner/debug \
| tr -s "\n()=:" " " \
| sed 's/none/none none/g; s/\// /g' \
| grep "$OUTFILTER" \
| grep "tun" )
echo $RESULTS
done )
ScanResults=$(echo "$ScanResults" | grep ^tun)
echo -e "Unocking $ScanDev, tuner $ScanTuner with key $LOCKKEY\n"
$HDHRConfig $ScanDev key $LOCKKEY set /tuner$ScanTuner/lockkey none
if [ "$OUTFILTER" != "." ]
then
ScanResults=$(echo "$ScanResults" | grep ^tun)
fi
NumChannels=$(wc -l <<< "$ScanResults")
echo "$NumChannels channels found"

Expand Down

0 comments on commit 9cd774a

Please sign in to comment.