I have a file (userbouquet.test.tv) with the following format:
#NAME 4.8E-Astra
#SERVICE 1:64:5:0:0:0:0:0:0:0::PVU 12322 V 27500 5-6
#DESCRIPTION PVU 12322 V 27500 5-6
#SERVICE 1:0:1:64:1:5E:30B022:0:0:0:
#SERVICE 1:0:1:190:1:5E:30B022:0:0:0:
#SERVICE 1:64:6:0:0:0:0:0:0:0::PVU 12360 V 27500 5-6
#DESCRIPTION PVU 12360 V 27500 5-6
#SERVICE 1:0:1:258:1:5E:300000:0:0:0:
Could you help me with one script that reads each line and check if line begins with string #SERVICE.
If line begins with string #SERVICE then to assign the coresponding value (for example 1:64:5:0:0:0:0:0:0:0::) into a variable.
EDiT 1: only lines that begin with string #SERVICE and end with ":" (example #SERVICE 1:0:1:64:1:5E:30B022:0:0:0:)
The lines that begin with string #SERVICE but end with a text (comment) should also be ignored (example #SERVICE 1:64:5:0:0:0:0:0:0:0::PVU 12322 V 27500 5-6)
I managed to writte the following:
#!/bin/bash
userbouquet="/etc/enigma2/userbouquet.test.tv"
for (( i=1; i<=$(grep "" -c $userbouquet); i++ ))
do
#
# HELP ME HERE
#
wget -q -O - http://127.0.0.1/web/zap?sRef={variable}
#example wget -q -O - http://127.0.0.1/web/zap?sRef=1:64:5:0:0:0:0:0:0:0::
sleep 3s
done
userbouquet.test.tv? The same file?