Aggancia questa barra allo schermo |  Disattiva gli effetti grafici

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.



Script webRadio UniSa in bash per StudentIngegneria

Un piccolo script in bash che ho scritto per l'associazione studentesca studentIngegneria dell'università di Salerno. script


Questo script se lasciato in esecuzione, alle 13 alza il volume, riproduce un jingle e poi la webradio dell'università.

Alle 15 interrompe la radio, riproduce un altro jingle e riabbassa il volume.

radio.sh

# (C) 2011, Andrea Peluso.

while [ true ]
do
  while [ true ]
  do
    MINUTI=$(expr `date +%k` \* 60 + `date +%M`)
    if [ "$MINUTI" -ge "780" -a "$MINUTI" -lt "900" ]; then
      amixer -c 0 set PCM 25
      play /usr/share/sounds/KDE_Startup_new.wav
      sleep 1
      mplayer http://193.205.160.175/stream &
      break
    fi
    sleep 60
  done
  while [ true ]
  do
    MINUTI=$(expr `date +%k` \* 60 + `date +%M`)
    if [ "$MINUTI" -ge "900" ]; then
      killall mplayer
      sleep 1
      play /usr/share/sounds/KDE_Logout_new.wav
      amixer -c 0 set PCM 5
      break
    fi
    sleep 60
  done
done
Scarica [.sh]    ...scaricato 31 volte, dimensione: 1 KB

Scritto da: Andrea Peluso (sya54M), .

Commenti

Nessun commento.

I campi contrassegnati con * sono obbligatori.

Condividi sui tuoi social preferiti!

Telegram Facebook Linkedin Twitter Pinterest
.