9009fdaeeef66b795347362c1a6630edcd2377e4
[xonotic/xonotic-music.pk3dir.git] / cdtracks.sh
1 #!/bin/sh
2
3 set -ex
4 cd sound/cdtracks
5 for F in *.ogg; do
6         T=${F%.ogg} # for tracker files we still need the ext
7         if ! grep "^cdtrack [1-9][0-9]* $T" ../../cdtracks.cfg >/dev/null; then
8                 n=`tail -n 1 ../../cdtracks.cfg | cut -d ' ' -f 2`
9                 n=$(($n+1))
10                 echo "_cdtrack $n $T" >> ../../cdtracks.cfg
11         fi
12 done