2016-04-23 00:03:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright (c) 2016 Nicolás A. Ortega
|
|
|
|
# License: GNU GPLv3
|
|
|
|
|
2016-04-23 12:07:45 +00:00
|
|
|
while true
|
|
|
|
do
|
|
|
|
read -p "Should Ogg-Converter confirm each conversion? (y/n)" ANSWER
|
|
|
|
case $ANSWER in
|
|
|
|
[yY]* ) CONFIRMATION=true
|
|
|
|
break;;
|
|
|
|
|
|
|
|
[nN]* ) CONFIRMATION=false
|
|
|
|
break;;
|
|
|
|
|
|
|
|
* ) echo "Please enter a valid option."
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-04-23 00:03:59 +00:00
|
|
|
for f in $@
|
|
|
|
do
|
2016-04-23 10:36:32 +00:00
|
|
|
OUTFILE=${f:0:-4}
|
|
|
|
echo "Convert $f to $OUTFILE.ogg"
|
2016-04-23 12:07:45 +00:00
|
|
|
if $CONFIRMATION
|
|
|
|
then
|
|
|
|
while true
|
|
|
|
do
|
|
|
|
read -p "Do you wish to continue? (y/n) " ANSWER
|
|
|
|
case $ANSWER in
|
|
|
|
[yY]* ) ffmpeg -loglevel warning -i $f $OUTFILE.ogg
|
|
|
|
break;;
|
2016-04-23 10:36:32 +00:00
|
|
|
|
2016-04-23 12:07:45 +00:00
|
|
|
[nN]* ) echo "Skipped file $f"
|
|
|
|
break;;
|
2016-04-23 10:36:32 +00:00
|
|
|
|
2016-04-23 12:07:45 +00:00
|
|
|
* ) echo "Please enter a valid option."
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
else
|
|
|
|
ffmpeg -loglevel warning -i $f $OUTFILE.ogg
|
|
|
|
fi
|
2016-04-23 00:03:59 +00:00
|
|
|
done
|