Right guys, that's my jade mod for the 500 just about complete now apart from the last script which is driving me a bit mad!

Anyway - The image uses two cam files - evocamd and scam
evocamd works great for me with no freezing, however some people report that it freezes sometimes so I also use scam which doesn't freeze but also doesn't use rom files to update so it gets the key from keylist.txt which evocamd does autoupdate.

As scam is a little weird and doesn't use the same provider key that scam uses it's sort of not working right as it uses the wrong key provider for it's nagra keyfile:

for example nagra uses provider 5a01 where scam uses 5b01

anyway I modded a script to make it use 5b01 - but it enters this vlaue manually, which is great if that's your provider but not great if it isn't as different areas in the uk use different providers.

I am looking for help to mod this script so that all UK key providers are catered for:

Code:
KEYFILE=/var/keys/Keylist.txt

	key0=`grep " 00 " $KEYFILE`
	prov1=`expr substr "$key0" 3 2`
	prov2=`expr substr "$key0" 5 2`
	key01=`expr substr "$key0" 11 2`
	key02=`expr substr "$key0" 13 2`
	key03=`expr substr "$key0" 15 2`
	key04=`expr substr "$key0" 17 2`
	key05=`expr substr "$key0" 19 2`
	key06=`expr substr "$key0" 21 2`
	key07=`expr substr "$key0" 23 2`
	key08=`expr substr "$key0" 25 2`
	
	key1=`grep " 01 " $KEYFILE`
	key11=`expr substr "$key1" 11 2`
	key12=`expr substr "$key1" 13 2`
	key13=`expr substr "$key1" 15 2`
	key14=`expr substr "$key1" 17 2`
	key15=`expr substr "$key1" 19 2`
	key16=`expr substr "$key1" 21 2`
	key17=`expr substr "$key1" 23 2`
	key18=`expr substr "$key1" 25 2`

	echo "N: { 5B01 00 { $key01 $key02 $key03 $key04 $key05 $key06 $key07 $key08  } } SysID: ($prov1$prov2)" > /var/keys/nagra
	echo "N: { 5B01 01 { $key11 $key12 $key13 $key14 $key15 $key16 $key17 $key18  } } SysID: ($prov1$prov2)" >> /var/keys/nagra 

chmod 755 /var/keys/*
Any help would be appreciated - thanks.