Jump to content


Member Since 16 Aug 2017
Offline Last Active Yesterday, 19:25

Topics I've Started

Bash script for creating bouquet list from webradio api

21 August 2022 - 14:59

Just made a quick bash script for creating bouquet files asking http://de1.api.radio...o/#List_of_tags api:s base on music style since I like to use the bouquet than I don’t need to have the Tv on for changing channels. Enjoy

As I say it was quick made so it can be improved! But working.

read -p 'Enter music style : ' tag
wget -O $dest/radio_search.tmp http://de1.api.radio-browser.info/json/tags/$tag
cat $dest/radio_search.tmp| sed 's/","/\n/g'| sed 's/stationcount"://'| sed 's/},{"name":"/\t/'
read -p 'Choose one of the above choices : ' tag
wget -O $dest/radio_search.tmp http://de1.api.radio-browser.info/json/stations/bytag/$tag
cat -n $dest/radio_search.tmp | sed 's/","/\n/g'| grep "url\""|sed 's/url\"\:\"//g'>$dest/radio_url.tmp
cat -n $dest/radio_search.tmp | sed 's/","/\n/g'| grep "name\""|sed 's/name\"\:\"//g'>$dest/radio_name.tmp
cat -n $dest/radio_search.tmp | sed 's/","/\n/g'| grep "language\""|sed 's/language\"\:\"//g'>$dest/radio_language.tmp
cat -n $dest/radio_search.tmp | sed 's/","/\n/g'| grep "bitrate\""|sed 's/bitrate\"\:\"//g'|sed 's/,"hls*.*//'|sed 's/"//'>$dest/radio_bitrate.tmp
sed -i 's/:/%3a/g' $dest/radio_url.tmp
sed -i 's/^/#SERVICE 4097:0:2:0:100D:0:0:0:0:0:/' $dest/radio_url.tmp
sed -i 's|$|:|' $dest/radio_url.tmp
# Add #DESCRIPTIO lang and bitrate to name file
sed -i 's/^/#DESCRIPTION /' $dest/radio_name.tmp 
paste -d ":" $dest/radio_name.tmp $dest/radio_language.tmp>$dest/radio_name.tmp1
paste -d ":" $dest/radio_name.tmp1 $dest/radio_bitrate.tmp>$dest/radio_name.tmp2
read -p 'Enter name for the new bouquet file. userbouquet.???????.radio: ' name
# Merge Url and name to one file
echo "#NAME $name">$dest/userbouquet.$name.radio
paste -d \\n $dest/radio_url.tmp $dest/radio_name.tmp2>>$dest/userbouquet.$name.radio
# Delete low bitrate 32,48,56,64,96 and the line above
sed -i 's/bitrate:32$/remove/' $dest/userbouquet.$name.radio
sed -i 's/bitrate:48$/remove/' $dest/userbouquet.$name.radio
sed -i 's/bitrate:56$/remove/' $dest/userbouquet.$name.radio
sed -i 's/bitrate:64$/remove/' $dest/userbouquet.$name.radio
sed -i 's/bitrate:96$/remove/' $dest/userbouquet.$name.radio
sed -i 'N;/remove/!P;D' $dest/userbouquet.$name.radio
no=$(cat $dest/userbouquet.$name.radio| wc -l)
let "no=($no-1)/2"; echo Adding $no stations to /etc/enigma2/userbouquet.$name.radio
read -p 'yes/no ? : ' i
if [[ "$i" == "yes" ]]; then
    mv $dest/userbouquet.$name.radio /etc/enigma2/userbouquet.$name.radio
    echo "Reload userbouquet "
    wget -qO - ""
rm -rf $dest/radio_*.tmp* 
rm -rf $dest/userbouquet.$name.radio 




30 May 2022 - 18:44

I just wounder if the order of the lines in the settings file is important? Why I asking is that is that I am making Ansible roles for my config and have no "clean" file to start with. And of cause different settings on my boxes so I can't use one as a template need to use the lineinfile module.

Openpli 8.2 Vu+ Uno4k with Otagon WL308 Optima Wifi usb adapter

23 May 2022 - 19:19

After update from 8.1 it was very tricky to get the wlan adapter as a default network adapter after every reboot the wlan adapter was disabled even if I saved it.
Solution was to get the wlan adapter to work, then just turn off the stb by the power switch. Then was wlan enabled after reboot.

The 8.1 was a quit clean installation with not to many plugins installed, than upgrade by the software upgrade.