source: ipk/source.mipsel/emus_gbox_804/_path_/bin/startgbox_804 @ 27860

Last change on this file since 27860 was 27860, checked in by andyjetset, 9 years ago

fix

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2#
3
4echo start
5rm /tmp/gbox.read
6(sleep 5;touch /tmp/gbox.kill)&
7./gbox_804 > /tmp/gbox.read
8
9echo "###########################################################################################"
10echo "###########################################################################################"
11echo "###########################      read CAM IDent       #####################################"
12echo "###########################################################################################"
13echo "###########################################################################################"
14
15card1=`cat /tmp/gbox.read | grep "CAM IDent" | grep -v UA:0x | cut -d ":" -f3`
16
17if [ ! -z "$card1" ];then
18        echo "[startgbox] card1 $card1"
19
20        #| sed -e 's/.\{7\}$//'
21        v1=`echo $card1 | cut -c1`
22        v2=`echo $card1 | cut -c2`
23        v3=`echo $card1 | cut -c3`
24        v4=`echo $card1 | cut -c4`
25        v5=`echo $card1 | cut -c5`
26        v6=`echo $card1 | cut -c6`
27        v7=`echo $card1 | cut -c7`
28        v8=`echo $card1 | cut -c8`
29       
30        rsa1="$v1$v2 $v3$v4 $v5$v6 $v7$v8"
31        echo "[startgbox] rsa1 $rsa1"
32       
33        sed "s/B: {.*/B: { $rsa1 { A7 64 2F 57 BC 96 D3 7C }}/" -i var/keys/nagra
34fi
35
36card2=`cat /tmp/gbox.read | grep "CAM IDent" | grep UA:0x | cut -d ":" -f3 | sed -e 's/^0x//'`
37
38if [ ! -z "$card2" ];then
39        echo "[startgbox] card2 $card2"
40
41        #| sed -e 's/.\{7\}$//'
42        v1=`echo $card2 | cut -c1`
43        v2=`echo $card2 | cut -c2`
44        v3=`echo $card2 | cut -c3`
45        v4=`echo $card2 | cut -c4`
46        v5=`echo $card2 | cut -c5`
47        v6=`echo $card2 | cut -c6`
48        v7=`echo $card2 | cut -c7`
49        v8=`echo $card2 | cut -c8`
50       
51        rsa2="$v1$v2 $v3$v4 $v5$v6 $v7$v8"
52        echo "[startgbox] rsa2 $rsa2"
53       
54        sed "s/B: {.*/B: { $rsa2 { A7 64 2F 57 BC 96 D3 7C }}/" -i var/keys/nagra
55fi
56
57if [ ! -z "$card1" ] && [ ! -z "$card2" ];then
58        sed "s/B: {.*/B: { $rsa1 { A7 64 2F 57 BC 96 D3 7C }}\nB: { $rsa2 { A7 64 2F 57 BC 96 D3 7C }}/" -i var/keys/nagra
59fi
60
61./gbox_804 &
Note: See TracBrowser for help on using the repository browser.