#! /bin/sh # # re_jackmixer init.d script # run re_fallback from this script PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin set -e PLS="/home/music/fallback.m3u" # if re_codec is installed properly we prefere to read the configfile [ -e /etc/reboot.fm/re_codec_read_config ] && PLS=`/etc/reboot.fm/re_codec_read_config fallback_playlist` case "$1" in start) echo -n "Starting alsaplayer: fallback" alsaplayer -s player_fallback -i text -o jack -d re_jackmixer:fallback_1,re_jackmixer:fallback_2 $PLS 2>&1 >/dev/null & echo "." ;; stop) echo -n "Stopping alsaplayer: fallback" ap-control -s player_fallback quit kill -9 `ps ax | awk '/alsaplayer\ .*player_fallback/ {print $1}'` echo "." ;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting fallback:" $0 stop sleep 1 $0 start echo "." ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0