#/bin/bash # Source function library. . /etc/rc.d/init.d/functions SOURCEDIR=/var/www/vhosts/horizon-music.com/web_users/source PLAYLIST1=$SOURCEDIR/playlist.txt PLAYLIST2=$SOURCEDIR/playlist.txt.old ICES=/usr/bin/ices ICESCONF=/etc/ices.conf if ! diff <(find $SOURCEDIR -name "*.mp3") $PLAYLIST2 2>/dev/null; then echo -n "Tuons ices: " killproc ices echo echo -n "Sauvegarde de la vielle playlist: " cp -f $PLAYLIST1 $PLAYLIST2 && find $SOURCEDIR -name "*.mp3" > $PLAYLIST1 && success || failure echo echo -n "Relancons le: " $ICES -B -c $ICESCONF && success || failure echo else echo "pas besoin!" fi