#!/bin/sh
# Batchfile for encoding CD FE11B412 to MP3
# Album "unknown"

# Generated by WSPse's MP3c V0.31 (Batch V1.1b)

dev1=/dev/stdout	# show STDOUT messages
dev2=/dev/null		# ignore STDERR stream
unset verbose		# reduce output by this script
mode=3			# rip and encode
order=1			# rip tracks before encode

while [ "$1" != "" ]; do
  case $1 in
    -1) mode=1;;
    -2) mode=2;;
    -3) mode=4;;
    -a) mode=3
        if [ "$2" = "0" ]; then order=0; shift;
        elif [ "$2" = "1" ]; then order=1; shift;
        fi;;
    -v) verbose=1;;
    -O) dev1=/dev/null;;
    -o) dev1=/dev/stdout;;
    -E) dev2=/dev/null;;
    -e) dev2=/dev/stderr;;
    -V) cat <<EOF

Script for FE11B412, V1.1b
Generated by WSPse's MP3c V0.31
EOF
        exit 0;;
    -h) cat <<EOF

Available options for this script:
-1: rip tracks only and exit
-2: only encode (tracks must be already ripped for this)
-3: create mp3's on the fly
-a <order>: rip and encode by <order> (default)
  order = 0: encode track directly after ripping
  order = 1: first rip all tracks and then start encoding (default)
-v: activate verbose mode
-O: disable STDOUT from external programs
-o: enable STDOUT (default)
-E: disable STDERR (default)
-e: enable STDERR
-V: show script-version information
-h: this help
EOF
        exit 0;;
    *) echo "unkown option '$1' (try -h for help)"
       exit 1;;
  esac
  shift
done

##########
# PASS 1 #
##########

if [ $verbose ]; then echo "* * * * * PASS 1 * * * * *"; fi;

if [ "$mode" != "2" ]; then	# encoding only is part of pass 2
#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 1 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 1 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 1 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "1" --tg "147" - "/audio/unknown-01_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 1 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 1 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 1-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 1 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 1 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_00.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 1 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 1 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 1----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 1 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "1" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_00.wav" "/audio/unknown-01_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 1 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_00.wav"		# delete tempfile
if [ $verbose ]; then echo "track 1 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 1 into m3u-file----------------------
if test -e "/audio/unknown-01_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-01_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 2 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 2 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 2 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "2" --tg "147" - "/audio/unknown-02_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 2 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 2 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 2-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 2 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 2 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_01.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 2 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 2 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 2----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 2 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "2" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_01.wav" "/audio/unknown-02_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 2 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_01.wav"		# delete tempfile
if [ $verbose ]; then echo "track 2 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 2 into m3u-file----------------------
if test -e "/audio/unknown-02_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-02_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 3 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 3 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 3 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "3" --tg "147" - "/audio/unknown-03_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 3 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 3 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 3-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 3 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 3 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_02.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 3 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 3 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 3----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 3 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "3" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_02.wav" "/audio/unknown-03_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 3 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_02.wav"		# delete tempfile
if [ $verbose ]; then echo "track 3 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 3 into m3u-file----------------------
if test -e "/audio/unknown-03_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-03_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 4 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 4 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 4 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "4" --tg "147" - "/audio/unknown-04_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 4 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 4 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 4-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 4 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 4 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_03.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 4 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 4 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 4----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 4 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "4" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_03.wav" "/audio/unknown-04_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 4 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_03.wav"		# delete tempfile
if [ $verbose ]; then echo "track 4 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 4 into m3u-file----------------------
if test -e "/audio/unknown-04_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-04_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 5 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 5 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 5 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "5" --tg "147" - "/audio/unknown-05_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 5 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 5 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 5-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 5 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 5 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_04.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 5 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 5 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 5----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 5 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "5" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_04.wav" "/audio/unknown-05_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 5 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_04.wav"		# delete tempfile
if [ $verbose ]; then echo "track 5 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 5 into m3u-file----------------------
if test -e "/audio/unknown-05_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-05_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 6 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 6 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 6 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "6" --tg "147" - "/audio/unknown-06_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 6 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 6 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 6-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 6 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 6 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_05.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 6 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 6 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 6----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 6 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "6" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_05.wav" "/audio/unknown-06_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 6 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_05.wav"		# delete tempfile
if [ $verbose ]; then echo "track 6 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 6 into m3u-file----------------------
if test -e "/audio/unknown-06_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-06_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 7 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 7 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 7 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "7" --tg "147" - "/audio/unknown-07_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 7 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 7 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 7-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 7 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 7 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_06.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 7 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 7 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 7----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 7 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "7" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_06.wav" "/audio/unknown-07_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 7 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_06.wav"		# delete tempfile
if [ $verbose ]; then echo "track 7 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 7 into m3u-file----------------------
if test -e "/audio/unknown-07_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-07_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 8 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 8 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 8 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "8" --tg "147" - "/audio/unknown-08_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 8 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 8 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 8-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 8 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 8 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_07.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 8 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 8 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 8----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 8 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "8" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_07.wav" "/audio/unknown-08_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 8 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_07.wav"		# delete tempfile
if [ $verbose ]; then echo "track 8 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 8 into m3u-file----------------------
if test -e "/audio/unknown-08_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-08_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 9 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 9 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 9 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "9" --tg "147" - "/audio/unknown-09_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 9 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 9 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 9-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 9 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 9 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_08.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 9 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 9 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 9----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 9 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "9" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_08.wav" "/audio/unknown-09_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 9 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_08.wav"		# delete tempfile
if [ $verbose ]; then echo "track 9 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 9 into m3u-file----------------------
if test -e "/audio/unknown-09_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-09_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 10 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 10 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 10 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "10" --tg "147" - "/audio/unknown-10_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 10 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 10 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 10-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 10 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 10 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_09.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 10 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 10 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 10----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 10 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "10" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_09.wav" "/audio/unknown-10_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 10 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_09.wav"		# delete tempfile
if [ $verbose ]; then echo "track 10 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 10 into m3u-file----------------------
if test -e "/audio/unknown-10_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-10_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 11 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 11 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 11 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "11" --tg "147" - "/audio/unknown-11_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 11 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 11 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 11-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 11 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 11 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_10.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 11 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 11 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 11----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 11 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "11" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_10.wav" "/audio/unknown-11_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 11 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_10.wav"		# delete tempfile
if [ $verbose ]; then echo "track 11 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 11 into m3u-file----------------------
if test -e "/audio/unknown-11_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-11_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 12 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 12 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 12 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "12" --tg "147" - "/audio/unknown-12_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 12 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 12 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 12-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 12 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 12 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_11.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 12 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 12 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 12----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 12 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "12" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_11.wav" "/audio/unknown-12_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 12 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_11.wav"		# delete tempfile
if [ $verbose ]; then echo "track 12 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 12 into m3u-file----------------------
if test -e "/audio/unknown-12_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-12_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 13 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 13 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 13 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "13" --tg "147" - "/audio/unknown-13_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 13 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 13 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 13-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 13 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 13 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_12.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 13 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 13 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 13----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 13 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "13" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_12.wav" "/audio/unknown-13_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 13 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_12.wav"		# delete tempfile
if [ $verbose ]; then echo "track 13 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 13 into m3u-file----------------------
if test -e "/audio/unknown-13_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-13_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 14 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 14 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 14 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "14" --tg "147" - "/audio/unknown-14_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 14 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 14 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 14-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 14 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 14 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_13.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 14 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 14 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 14----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 14 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "14" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_13.wav" "/audio/unknown-14_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 14 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_13.wav"		# delete tempfile
if [ $verbose ]; then echo "track 14 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true
#--- Batchtask: insert track 14 into m3u-file----------------------
if test -e "/audio/unknown-14_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-14_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

#-{
if [ "$mode" = "4" ]; then	# on-the-fly encode
#--- Batchtask: ripping and encoding track 15 (on the fly)---------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "on the fly creation of track 15 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 15 -O wav -paranoia - 2> $dev2 | /usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "15" --tg "147" - "/audio/unknown-15_FE11B412.ogg" 1> $dev1 2> $dev2
if [ "$?" != "0" ]; then
  echo "encoding track 15 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 15 encoded."; fi;

else			# rip following track
#--- Batchtask: ripping track 15-----------------------------------
mkdir -p "/tmp/"						# So, we need tmpdir, eh
if [ $verbose ]; then echo "ripping track 15 in progress"; fi;
/usr/bin/cdda2wav -D "/dev/cdrom" -t 15 -O wav -paranoia "/tmp/WSPse-MP3Creatfe11b412_14.wav" 1> $dev1 2> $dev2 	# Grabprogram
if [ ! "$?" = "0" ]; then
  echo "ripping track 15 failed, abort now"
  exit 1
fi
if [ $verbose ]; then echo "track 15 ripped."; fi;

  if [ "$mode" = "3" -a "$order" = "0" ]; then	# encoding should be also done
#--- Batchtask: encoding track 15----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 15 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "15" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_14.wav" "/audio/unknown-15_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 15 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_14.wav"		# delete tempfile
if [ $verbose ]; then echo "track 15 encoded."; fi;

  fi
fi
if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then	# was encoded
true


--------------------

cut 

--------------------

#--- Batchtask: insert track 18 into m3u-file----------------------
if test -e "/audio/unknown-18_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-18_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

fi
#-}

if [ "$mode" = "3" -a "$order" = "0" -o "$mode" = "4" ]; then
  echo "ENCODING FINISHED!"
  exit 0
fi
if [ "$mode" = "1" ]; then
  echo "RIPPING FINISHED!"
  exit 0
fi
fi

##########
# PASS 2 #
##########

if [ $verbose ]; then echo "* * * * * PASS 2 * * * * *"; fi;

if [ -f "/tmp/WSPse-MP3Creatfe11b412_00.wav" ]; then
#--- Batchtask: encoding track 1----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 1 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "1" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_00.wav" "/audio/unknown-01_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 1 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_00.wav"		# delete tempfile
if [ $verbose ]; then echo "track 1 encoded."; fi;

true
#--- Batchtask: insert track 1 into m3u-file----------------------
if test -e "/audio/unknown-01_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-01_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

else
 echo Skipping 1
fi
if [ -f "/tmp/WSPse-MP3Creatfe11b412_01.wav" ]; then
#--- Batchtask: encoding track 2----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 2 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "2" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_01.wav" "/audio/unknown-02_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 2 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_01.wav"		# delete tempfile
if [ $verbose ]; then echo "track 2 encoded."; fi;

true
#--- Batchtask: insert track 2 into m3u-file----------------------
if test -e "/audio/unknown-02_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-02_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

else
 echo Skipping 2
fi
if [ -f "/tmp/WSPse-MP3Creatfe11b412_02.wav" ]; then
#--- Batchtask: encoding track 3----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 3 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "3" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_02.wav" "/audio/unknown-03_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 3 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_02.wav"		# delete tempfile
if [ $verbose ]; then echo "track 3 encoded."; fi;

true
#--- Batchtask: insert track 3 into m3u-file----------------------
if test -e "/audio/unknown-03_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-03_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

else
 echo Skipping 3
fi
if [ -f "/tmp/WSPse-MP3Creatfe11b412_03.wav" ]; then
#--- Batchtask: encoding track 4----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 4 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "4" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_03.wav" "/audio/unknown-04_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 4 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_03.wav"		# delete tempfile
if [ $verbose ]; then echo "track 4 encoded."; fi;

true
#--- Batchtask: insert track 4 into m3u-file----------------------
if test -e "/audio/unknown-04_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-04_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

else
 echo Skipping 4
fi
if [ -f "/tmp/WSPse-MP3Creatfe11b412_04.wav" ]; then
#--- Batchtask: encoding track 5----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 5 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "5" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_04.wav" "/audio/unknown-05_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 5 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_04.wav"		# delete tempfile
if [ $verbose ]; then echo "track 5 encoded."; fi;

true
#--- Batchtask: insert track 5 into m3u-file----------------------
if test -e "/audio/unknown-05_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-05_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

else
 echo Skipping 5
fi
if [ -f "/tmp/WSPse-MP3Creatfe11b412_05.wav" ]; then
#--- Batchtask: encoding track 6----------------------------------
mkdir -p "/audio/"						# MP3-destination dir
if [ $verbose ]; then echo "encoding track 6 in progress"; fi;
/usr/bin/lame --preset standard --tt "unknown" --ta "unknown" --tl "unknown" --ty "1999" --tc "generated at 04.05.2008" --tn "6" --tg "147" "/tmp/WSPse-MP3Creatfe11b412_05.wav" "/audio/unknown-06_FE11B412.ogg" 1> $dev1 2> $dev2	# Encoder
if [ "$?" != "0" ]; then
  echo "encoding track 6 failed, abort now"
  exit 1
fi
rm -f "/tmp/WSPse-MP3Creatfe11b412_05.wav"		# delete tempfile
if [ $verbose ]; then echo "track 6 encoded."; fi;

--------------------

cut

--------------------


true
#--- Batchtask: insert track 18 into m3u-file----------------------
if test -e "/audio/unknown-18_FE11B412.ogg"; then	# if mp3-file exists
  mkdir -p "/audio/Unknown/"		# directory for m3u-file
  echo "../unknown-18_FE11B412.ogg" >> "/audio/Unknown/1999-Unknown.m3u"
else
  echo "warning, new mp3-file wasn't found"
fi
if [ $verbose ]; then echo "m3u-list updated."; fi;

else
 echo Skipping 18
fi
echo "ENCODING FINISHED!"
exit 0

# End of script. Thanks for using MP3c
# MP3c is available here: http://www.wspse.de/WSPse/Linux-MP3c.php3
# WSPse, Matthias Hensler 1999/2000
