Added error checking when defining time (ks-mix)
This commit is contained in:
parent
cdb03d2157
commit
fbfb4c5969
270
src/ks-mix
270
src/ks-mix
|
@ -534,32 +534,77 @@ elif [ "${1}" == "-evti" ] ; then
|
||||||
video_track="${video_track}"
|
video_track="${video_track}"
|
||||||
fi
|
fi
|
||||||
# Ask for hour to cut
|
# Ask for hour to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
||||||
|
expr 1 + ${hour_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${hour_cut}" ] ; then
|
if [ -z "${hour_cut}" ] ; then
|
||||||
hourZero=$(zero_number "${hourCut}")
|
hourZero=$(zero_number "${hourCut}")
|
||||||
hourCut="${hourZero}"
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cut} -le 99 ] ; then
|
||||||
hourZero=$(zero_number "${hour_cut}")
|
hourZero=$(zero_number "${hour_cut}")
|
||||||
hourCut="${hourZero}"
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
||||||
|
expr 1 + ${minute_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${minute_cut}" ] ; then
|
if [ -z "${minute_cut}" ] ; then
|
||||||
minuteZero=$(zero_number "${minuteCut}")
|
minuteZero=$(zero_number "${minuteCut}")
|
||||||
minuteCut="${minuteZero}"
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cut} -le 59 ] ; then
|
||||||
minuteZero=$(zero_number "${minute_cut}")
|
minuteZero=$(zero_number "${minute_cut}")
|
||||||
minuteCut="${minuteZero}"
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
||||||
|
expr 1 + ${second_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${second_cut}" ] ; then
|
if [ -z "${second_cut}" ] ; then
|
||||||
secondZero=$(zero_number "${secondCut}")
|
secondZero=$(zero_number "${secondCut}")
|
||||||
secondCut="${secondZero}"
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cut} -le 59 ] ; then
|
||||||
secondZero=$(zero_number "${second_cut}")
|
secondZero=$(zero_number "${second_cut}")
|
||||||
secondCut="${secondZero}"
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
echo -n "* (Default: n) Extract video from ${hourCut}:${minuteCut}:${secondCut} to end? (y/n): " ; read accept_extraction
|
echo -n "* (Default: n) Extract video from ${hourCut}:${minuteCut}:${secondCut} to end? (y/n): " ; read accept_extraction
|
||||||
if [ "${accept_extraction}" == "y" ] ; then
|
if [ "${accept_extraction}" == "y" ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -579,32 +624,77 @@ elif [ "${1}" == "-evti" ] ; then
|
||||||
secondCutAfter=0
|
secondCutAfter=0
|
||||||
# Ask for hour to cut
|
# Ask for hour to cut
|
||||||
echo ""
|
echo ""
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
||||||
|
expr 1 + ${hour_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${hour_cutAfter}" ] ; then
|
if [ -z "${hour_cutAfter}" ] ; then
|
||||||
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cutAfter} -le 99 ] ; then
|
||||||
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
||||||
|
expr 1 + ${minute_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${minute_cutAfter}" ] ; then
|
if [ -z "${minute_cutAfter}" ] ; then
|
||||||
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cutAfter} -le 59 ] ; then
|
||||||
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
||||||
|
expr 1 + ${second_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${second_cutAfter}" ] ; then
|
if [ -z "${second_cutAfter}" ] ; then
|
||||||
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cutAfter} -le 59 ] ; then
|
||||||
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter})
|
hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter})
|
||||||
minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter})
|
minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter})
|
||||||
secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter})
|
secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter})
|
||||||
|
@ -680,32 +770,77 @@ elif [ "${1}" == "-eati" ] ; then
|
||||||
audio_track="${audio_track}"
|
audio_track="${audio_track}"
|
||||||
fi
|
fi
|
||||||
# Ask for hour to cut
|
# Ask for hour to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
||||||
|
expr 1 + ${hour_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${hour_cut}" ] ; then
|
if [ -z "${hour_cut}" ] ; then
|
||||||
hourZero=$(zero_number "${hourCut}")
|
hourZero=$(zero_number "${hourCut}")
|
||||||
hourCut="${hourZero}"
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cut} -le 99 ] ; then
|
||||||
hourZero=$(zero_number "${hour_cut}")
|
hourZero=$(zero_number "${hour_cut}")
|
||||||
hourCut="${hourZero}"
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
||||||
|
expr 1 + ${minute_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${minute_cut}" ] ; then
|
if [ -z "${minute_cut}" ] ; then
|
||||||
minuteZero=$(zero_number "${minuteCut}")
|
minuteZero=$(zero_number "${minuteCut}")
|
||||||
minuteCut="${minuteZero}"
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cut} -le 59 ] ; then
|
||||||
minuteZero=$(zero_number "${minute_cut}")
|
minuteZero=$(zero_number "${minute_cut}")
|
||||||
minuteCut="${minuteZero}"
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
||||||
|
expr 1 + ${second_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${second_cut}" ] ; then
|
if [ -z "${second_cut}" ] ; then
|
||||||
secondZero=$(zero_number "${secondCut}")
|
secondZero=$(zero_number "${secondCut}")
|
||||||
secondCut="${secondZero}"
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cut} -le 59 ] ; then
|
||||||
secondZero=$(zero_number "${second_cut}")
|
secondZero=$(zero_number "${second_cut}")
|
||||||
secondCut="${secondZero}"
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
echo -n "* (Default: n) Extract audio from ${hourCut}:${minuteCut}:${secondCut} to end? (y/n): " ; read accept_extraction
|
echo -n "* (Default: n) Extract audio from ${hourCut}:${minuteCut}:${secondCut} to end? (y/n): " ; read accept_extraction
|
||||||
if [ "${accept_extraction}" == "y" ] ; then
|
if [ "${accept_extraction}" == "y" ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -723,32 +858,77 @@ elif [ "${1}" == "-eati" ] ; then
|
||||||
secondCutAfter=0
|
secondCutAfter=0
|
||||||
# Ask for hour to cut
|
# Ask for hour to cut
|
||||||
echo ""
|
echo ""
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
||||||
|
expr 1 + ${hour_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${hour_cutAfter}" ] ; then
|
if [ -z "${hour_cutAfter}" ] ; then
|
||||||
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cutAfter} -le 99 ] ; then
|
||||||
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
||||||
|
expr 1 + ${minute_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${minute_cutAfter}" ] ; then
|
if [ -z "${minute_cutAfter}" ] ; then
|
||||||
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cutAfter} -le 59 ] ; then
|
||||||
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
||||||
|
expr 1 + ${second_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${second_cutAfter}" ] ; then
|
if [ -z "${second_cutAfter}" ] ; then
|
||||||
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cutAfter} -le 59 ] ; then
|
||||||
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter})
|
hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter})
|
||||||
minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter})
|
minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter})
|
||||||
secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter})
|
secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter})
|
||||||
|
@ -844,32 +1024,77 @@ elif [ "${1}" == "-evat" ] ; then
|
||||||
audio_track="${audio_track}"
|
audio_track="${audio_track}"
|
||||||
fi
|
fi
|
||||||
# Ask for hour to cut
|
# Ask for hour to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
||||||
|
expr 1 + ${hour_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${hour_cut}" ] ; then
|
if [ -z "${hour_cut}" ] ; then
|
||||||
hourZero=$(zero_number "${hourCut}")
|
hourZero=$(zero_number "${hourCut}")
|
||||||
hourCut="${hourZero}"
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cut} -le 99 ] ; then
|
||||||
hourZero=$(zero_number "${hour_cut}")
|
hourZero=$(zero_number "${hour_cut}")
|
||||||
hourCut="${hourZero}"
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
||||||
|
expr 1 + ${minute_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${minute_cut}" ] ; then
|
if [ -z "${minute_cut}" ] ; then
|
||||||
minuteZero=$(zero_number "${minuteCut}")
|
minuteZero=$(zero_number "${minuteCut}")
|
||||||
minuteCut="${minuteZero}"
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cut} -le 59 ] ; then
|
||||||
minuteZero=$(zero_number "${minute_cut}")
|
minuteZero=$(zero_number "${minute_cut}")
|
||||||
minuteCut="${minuteZero}"
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
||||||
|
expr 1 + ${second_cut} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${second_cut}" ] ; then
|
if [ -z "${second_cut}" ] ; then
|
||||||
secondZero=$(zero_number "${secondCut}")
|
secondZero=$(zero_number "${secondCut}")
|
||||||
secondCut="${secondZero}"
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cut} -le 59 ] ; then
|
||||||
secondZero=$(zero_number "${second_cut}")
|
secondZero=$(zero_number "${second_cut}")
|
||||||
secondCut="${secondZero}"
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
echo -n "* (Default: n) Extract audio from ${hourCut}:${minuteCut}:${secondCut} to end? (y/n): " ; read accept_extraction
|
echo -n "* (Default: n) Extract audio from ${hourCut}:${minuteCut}:${secondCut} to end? (y/n): " ; read accept_extraction
|
||||||
if [ "${accept_extraction}" == "y" ] ; then
|
if [ "${accept_extraction}" == "y" ] ; then
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -887,32 +1112,77 @@ elif [ "${1}" == "-evat" ] ; then
|
||||||
secondCutAfter=0
|
secondCutAfter=0
|
||||||
# Ask for hour to cut
|
# Ask for hour to cut
|
||||||
echo ""
|
echo ""
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
||||||
|
expr 1 + ${hour_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${hour_cutAfter}" ] ; then
|
if [ -z "${hour_cutAfter}" ] ; then
|
||||||
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cutAfter} -le 99 ] ; then
|
||||||
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
||||||
|
expr 1 + ${minute_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${minute_cutAfter}" ] ; then
|
if [ -z "${minute_cutAfter}" ] ; then
|
||||||
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cutAfter} -le 59 ] ; then
|
||||||
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
|
valid_time=0
|
||||||
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
||||||
|
expr 1 + ${second_cutAfter} &> /dev/null
|
||||||
|
error_time=$?
|
||||||
if [ -z "${second_cutAfter}" ] ; then
|
if [ -z "${second_cutAfter}" ] ; then
|
||||||
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
else
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cutAfter} -le 59 ] ; then
|
||||||
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter})
|
hourPlusRaw=$(expr ${hourCut} + ${hourCutAfter})
|
||||||
minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter})
|
minutePlusRaw=$(expr ${minuteCut} + ${minuteCutAfter})
|
||||||
secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter})
|
secondPlusRaw=$(expr ${secondCut} + ${secondCutAfter})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user