View previous topic :: View next topic |
Author |
Message |
pacho2 Developer
Joined: 04 Mar 2005 Posts: 2599 Location: Oviedo, Spain
|
Posted: Tue Jan 09, 2007 7:09 pm Post subject: script que dejó de funcionar |
|
|
Hace tiempo usaba un script que encontré via google para escuchar diferentes emisoras de radio con un pequeño gui hecho con zenity. Pero el script ha dejado de funcionar y falla con el siguiente error:
Code: |
line 213: opinc: command not found
|
El script se puede descargar de aquí y es éste:
Code: |
#!/bin/bash
function play () {
clear
zenity --title "Recuerda" --info --text "Para parar la reproducción pulsa Ctrl+C"
mplayer -playlist $1
}
function menu () {
clear
menuop=$(zenity --list --column "Nº" --column "Menú Principal" \
1 "Radios" 2 "Música")
if [ $? -eq 1 ]; then
menuop=0
fi
}
function menu_radio () {
clear
menura=$(zenity --list --column "Nº" --column "Emisora" \
1 "RNE 1" 2 "RNE 3" 3 "RNE 5" 4 "RNE Clásica" 5 "Onda Cero" 6 "Cadena Ser" 7 "Cadena Cope" 8 "M80 Radio" 9 "Cadena 100" 10 "Máxima FM" 11 "40 Principales" 12 "Radio10" 13 "BBC")
if [ $? -eq 1 ]; then
menura=0
fi
}
function menu_bbc () {
clear
opbbc=$(zenity --list --column "Nº" --column "Emisora BBC" \
1 "BBC 1" 2 "BBC 2" 3 "BBC 3" 4 "BBC 4" 5 "BBC 5" 6 "BBC 6" 7 "BBC 7")
if [ $? -eq 1 ]; then
opbbc=0
fi
}
function menu_candielc () {
clear
opcandielc=$(zenity --list --column "Nº" --column "Estilo Musical" \
1 "Trance" 2 "Hard Trance" 3 "Vocal Trance" 4 "Progressive" 5 "Euro Dance" 6 "Goa-Psy Trance" 7 "Deep House" 8 "Hard House" 9 "Hard Core" 10 "Classic Techo Trance" 11 "Chillout" 12 "DJ Mixes")
if [ $? -eq 1 ]; then
opcandielc=0
fi
}
function playel () {
clear
zenity --title "Recuerda" --info --text "Para parar la reproducción pulsa Ctrl+C"
mplayer -playlist http://www.di.fm/mp3/$1.pls
}
function nfunc () {
zenity --title "Recuerda" --error --text "Esta emisora no funciona por el momento."
}
### Ejecución ###
while [ true ]; do
menu
case $menuop in
"1")
while [ true ]; do
menu_radio
case $menura in
"0")
break
;;
"1")
play http://www.rtve.es/rne/audio/RNE1.ram
;;
"2")
play http://www.rtve.es/rne/audio/RNE3.ram
;;
"3")
play http://www.rtve.es/rne/audio/RNE5.ram
;;
"4")
play http://www.rtve.es/rne/audio/RNEclasica.ram
;;
"5")
play http://www.ondacero.es/oci.asx
;;
"6")
play http://www.cadenaser.com/player/SER-TIC.asx
;;
"7")
nfunc
;;
"8")
play http://www.los40.com/nuevo_player/m80.asx
;;
"9")
nfunc
;;
"10")
play http://www.los40.com/nuevo_player/maxima.asx
;;
"11")
play http://www.los40.com/nuevo_player/40Principales.asx
;;
"12")
play http://radio10.telecomdatacenter.com.ar/radio10
;;
"13")
while [ true ]; do
menu_bbc
case $opbbc in
"0")
break
;;
"1")
play http://www.bbc.co.uk/radio1/realaudio/media/r1live.ram
;;
"2")
play http://www.bbc.co.uk/radio2/realmedia/fmg2.ram
;;
"3")
play http://www.bbc.co.uk/radio3/ram/r3g2.ram
;;
"4")
play http://www.bbc.co.uk/radio4/realplayer/media/fmg2.ram
;;
"5")
play http://www.bbc.co.uk/fivelive/live/surestream_int.ram
;;
"6")
play http://www.bbc.co.uk/6music/ram/dsatg2.ram
;;
"7")
play http://www.bbc.co.uk/bbc7/realplayer/dsatg2.ram
;;
*)
opinc
;;
esac
done
;;
*)
opinc
;;
esac
done
;;
"2")
while [ true ]; do
menu_candielc
case $opcandielc in
"0")
break
;;
"1")
playel trance
;;
"2")
playel hardtrance
;;
"3")
playel vocaltrance
;;
"4")
playel progressive
;;
"5")
playel eurodance
;;
"6")
playel goapsy
;;
"7")
playel deephouse
;;
"8")
playel hardhouse
;;
"9")
playel hardcore
;;
"10")
playel classictechno
;;
"11")
playel chillout
;;
"12")
playel djmixes
;;
*)
opinc
;;
esac
done
;;
"3")
clear
exit
;;
*)
opinc
;;
esac
done
|
Saludos y gracias |
|
Back to top |
|
|
Kasabian Tux's lil' helper
Joined: 25 Dec 2006 Posts: 97 Location: Konoha village
|
Posted: Sat Jan 13, 2007 11:03 am Post subject: |
|
|
Al parecer es una función:
Code: | function opinc () {
echo " "
echo "Opcion incorrecta"
echo " "
sleep 2
} |
Via: Ubuntu-es
|
|
Back to top |
|
|
pacho2 Developer
Joined: 04 Mar 2005 Posts: 2599 Location: Oviedo, Spain
|
Posted: Sat Jan 13, 2007 12:20 pm Post subject: |
|
|
Ya lo resolví, es que se me pasó cerrar el hilo.
De todos modos muchas gracias por el interés y perdona por el tiempo perdido
Saludos |
|
Back to top |
|
|
|