[lastbash-cvs] lastbash lastbash,1.66,1.67
Status: Beta
Brought to you by:
cstroie
|
From: Costin S. <cs...@us...> - 2006-11-30 21:08:32
|
Update of /cvsroot/lastbash/lastbash In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv5744 Modified Files: lastbash Log Message: Some more required programs. Index: lastbash =================================================================== RCS file: /cvsroot/lastbash/lastbash/lastbash,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- lastbash 30 Nov 2006 20:50:21 -0000 1.66 +++ lastbash 30 Nov 2006 21:08:25 -0000 1.67 @@ -61,7 +61,7 @@ # Internal stuff PLAYERS="mplayer" -REQ_PROGRAMS="rm tput md5sum dd" +REQ_PROGRAMS="rm date sleep tput md5sum dd chmod" declare -a HTTP_HEADERS HTTP_RESPONSE CR=$'\x0d' LF=$'\x0a' @@ -608,7 +608,7 @@ # Set the info line field sizes # The fixed-size fields are the following # - the love/ban indicator: 1 char - # - the track duration: 5 chars + # - the track duration: 6 chars # Plus: 1 char at start and end of line # Plus: 2 chars between fields (this is computed) # Find the total relative units @@ -1200,6 +1200,12 @@ # Return if no player is to be used [ "${USE_PLAYER}" == "y" ] || return + if type -t mkfifo >/dev/null 2>&1 + then + debug "No way to control the player, mkfifo is absent" + return + fi + # Set the status line tui_sbar "Starting the backend player..." @@ -1320,7 +1326,7 @@ then PID="$(< $PID_FILE)" # Check if we can send a signal to that process - if kill -0 $PID >/dev/null 2>&1 + if kill -0 "${PID}" >/dev/null 2>&1 then RET="1" else @@ -1461,6 +1467,7 @@ *) if [ "${KEY}" ] then + # FIXME this is executed after a remote call, too tui_keys sleep 3 tui_sbar @@ -1484,7 +1491,7 @@ case "$1" in "-a") AUTO_PLAY="y" ;; "-A") AUTO_PLAY="n" ;; - "-c") LASTFM_COMMAND="$1"; shift 1 ;; + "-c") LASTFM_COMMAND="$2"; shift 1 ;; "-d") DEBUG="y" ;; "-p") PLAYER="$2"; shift 1 ;; "-r") REFRESH_INTERVAL="$2"; shift 1 ;; @@ -1504,8 +1511,6 @@ if [[ "$1" =~ "^lastfm://" ]] then # This is the new station to tune into - # FIXME %escape the url - if first_instance then # Store the station to load after the init @@ -1528,7 +1533,7 @@ # Check if there is a command to execute if [ "${LASTFM_COMMAND}" ] then - remote_call "$1" + remote_call "${LASTFM_COMMAND}" exit 0 else # Nothing to do @@ -1570,7 +1575,7 @@ player_stop else # Wait for the user read the status and exit - read -n 1 -s -t ${REFRESH_INTERVAL} KEY + read -n 1 -s -t ${REFRESH_INTERVAL} JUNK fi # Restore the terminal |