Added error checking when defining time (ks-mix)
This commit is contained in:
parent
cdb03d2157
commit
fbfb4c5969
558
src/ks-mix
558
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
|
||||||
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
valid_time=0
|
||||||
if [ -z "${hour_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
hourZero=$(zero_number "${hourCut}")
|
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
||||||
hourCut="${hourZero}"
|
expr 1 + ${hour_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
hourZero=$(zero_number "${hour_cut}")
|
if [ -z "${hour_cut}" ] ; then
|
||||||
hourCut="${hourZero}"
|
hourZero=$(zero_number "${hourCut}")
|
||||||
fi
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cut} -le 99 ] ; then
|
||||||
|
hourZero=$(zero_number "${hour_cut}")
|
||||||
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
valid_time=0
|
||||||
if [ -z "${minute_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
minuteZero=$(zero_number "${minuteCut}")
|
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
||||||
minuteCut="${minuteZero}"
|
expr 1 + ${minute_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
minuteZero=$(zero_number "${minute_cut}")
|
if [ -z "${minute_cut}" ] ; then
|
||||||
minuteCut="${minuteZero}"
|
minuteZero=$(zero_number "${minuteCut}")
|
||||||
fi
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cut} -le 59 ] ; then
|
||||||
|
minuteZero=$(zero_number "${minute_cut}")
|
||||||
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
valid_time=0
|
||||||
if [ -z "${second_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
secondZero=$(zero_number "${secondCut}")
|
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
||||||
secondCut="${secondZero}"
|
expr 1 + ${second_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
secondZero=$(zero_number "${second_cut}")
|
if [ -z "${second_cut}" ] ; then
|
||||||
secondCut="${secondZero}"
|
secondZero=$(zero_number "${secondCut}")
|
||||||
fi
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cut} -le 59 ] ; then
|
||||||
|
secondZero=$(zero_number "${second_cut}")
|
||||||
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
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 ""
|
||||||
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
valid_time=0
|
||||||
if [ -z "${hour_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
||||||
hourCutAfter="${hourZeroAfter}"
|
expr 1 + ${hour_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
if [ -z "${hour_cutAfter}" ] ; then
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
||||||
fi
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cutAfter} -le 99 ] ; then
|
||||||
|
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
||||||
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
valid_time=0
|
||||||
if [ -z "${minute_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
expr 1 + ${minute_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
if [ -z "${minute_cutAfter}" ] ; then
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
||||||
fi
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cutAfter} -le 59 ] ; then
|
||||||
|
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
||||||
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
valid_time=0
|
||||||
if [ -z "${second_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
||||||
secondCutAfter="${secondZeroAfter}"
|
expr 1 + ${second_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
if [ -z "${second_cutAfter}" ] ; then
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
||||||
fi
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cutAfter} -le 59 ] ; then
|
||||||
|
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
||||||
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
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
|
||||||
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
valid_time=0
|
||||||
if [ -z "${hour_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
hourZero=$(zero_number "${hourCut}")
|
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
||||||
hourCut="${hourZero}"
|
expr 1 + ${hour_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
hourZero=$(zero_number "${hour_cut}")
|
if [ -z "${hour_cut}" ] ; then
|
||||||
hourCut="${hourZero}"
|
hourZero=$(zero_number "${hourCut}")
|
||||||
fi
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cut} -le 99 ] ; then
|
||||||
|
hourZero=$(zero_number "${hour_cut}")
|
||||||
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
valid_time=0
|
||||||
if [ -z "${minute_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
minuteZero=$(zero_number "${minuteCut}")
|
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
||||||
minuteCut="${minuteZero}"
|
expr 1 + ${minute_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
minuteZero=$(zero_number "${minute_cut}")
|
if [ -z "${minute_cut}" ] ; then
|
||||||
minuteCut="${minuteZero}"
|
minuteZero=$(zero_number "${minuteCut}")
|
||||||
fi
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cut} -le 59 ] ; then
|
||||||
|
minuteZero=$(zero_number "${minute_cut}")
|
||||||
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
valid_time=0
|
||||||
if [ -z "${second_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
secondZero=$(zero_number "${secondCut}")
|
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
||||||
secondCut="${secondZero}"
|
expr 1 + ${second_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
secondZero=$(zero_number "${second_cut}")
|
if [ -z "${second_cut}" ] ; then
|
||||||
secondCut="${secondZero}"
|
secondZero=$(zero_number "${secondCut}")
|
||||||
fi
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cut} -le 59 ] ; then
|
||||||
|
secondZero=$(zero_number "${second_cut}")
|
||||||
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
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 ""
|
||||||
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
valid_time=0
|
||||||
if [ -z "${hour_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
||||||
hourCutAfter="${hourZeroAfter}"
|
expr 1 + ${hour_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
if [ -z "${hour_cutAfter}" ] ; then
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
||||||
fi
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cutAfter} -le 99 ] ; then
|
||||||
|
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
||||||
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
valid_time=0
|
||||||
if [ -z "${minute_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
expr 1 + ${minute_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
if [ -z "${minute_cutAfter}" ] ; then
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
||||||
fi
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cutAfter} -le 59 ] ; then
|
||||||
|
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
||||||
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
valid_time=0
|
||||||
if [ -z "${second_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
||||||
secondCutAfter="${secondZeroAfter}"
|
expr 1 + ${second_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
if [ -z "${second_cutAfter}" ] ; then
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
||||||
fi
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cutAfter} -le 59 ] ; then
|
||||||
|
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
||||||
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
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
|
||||||
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
valid_time=0
|
||||||
if [ -z "${hour_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
hourZero=$(zero_number "${hourCut}")
|
echo -n "* (Default: ${hourCut}) Type the hour (0-99): " ; read hour_cut
|
||||||
hourCut="${hourZero}"
|
expr 1 + ${hour_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
hourZero=$(zero_number "${hour_cut}")
|
if [ -z "${hour_cut}" ] ; then
|
||||||
hourCut="${hourZero}"
|
hourZero=$(zero_number "${hourCut}")
|
||||||
fi
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cut} -le 99 ] ; then
|
||||||
|
hourZero=$(zero_number "${hour_cut}")
|
||||||
|
hourCut="${hourZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
valid_time=0
|
||||||
if [ -z "${minute_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
minuteZero=$(zero_number "${minuteCut}")
|
echo -n "* (Default: ${minuteCut}) Type the minute (0-59): " ; read minute_cut
|
||||||
minuteCut="${minuteZero}"
|
expr 1 + ${minute_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
minuteZero=$(zero_number "${minute_cut}")
|
if [ -z "${minute_cut}" ] ; then
|
||||||
minuteCut="${minuteZero}"
|
minuteZero=$(zero_number "${minuteCut}")
|
||||||
fi
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cut} -le 59 ] ; then
|
||||||
|
minuteZero=$(zero_number "${minute_cut}")
|
||||||
|
minuteCut="${minuteZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
valid_time=0
|
||||||
if [ -z "${second_cut}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
secondZero=$(zero_number "${secondCut}")
|
echo -n "* (Default: ${secondCut}) Type the second (0-59): " ; read second_cut
|
||||||
secondCut="${secondZero}"
|
expr 1 + ${second_cut} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
secondZero=$(zero_number "${second_cut}")
|
if [ -z "${second_cut}" ] ; then
|
||||||
secondCut="${secondZero}"
|
secondZero=$(zero_number "${secondCut}")
|
||||||
fi
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cut} -le 59 ] ; then
|
||||||
|
secondZero=$(zero_number "${second_cut}")
|
||||||
|
secondCut="${secondZero}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
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 ""
|
||||||
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
valid_time=0
|
||||||
if [ -z "${hour_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
echo -n "* (Default: ${hourCutAfter}) Type how many hours from ${hourCut}:${minuteCut}:${secondCut} (0-99): " ; read hour_cutAfter
|
||||||
hourCutAfter="${hourZeroAfter}"
|
expr 1 + ${hour_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
if [ -z "${hour_cutAfter}" ] ; then
|
||||||
hourCutAfter="${hourZeroAfter}"
|
hourZeroAfter=$(zero_number "${hourCutAfter}")
|
||||||
fi
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${hour_cutAfter} -le 99 ] ; then
|
||||||
|
hourZeroAfter=$(zero_number "${hour_cutAfter}")
|
||||||
|
hourCutAfter="${hourZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 99 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-99)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for minute to cut
|
# Ask for minute to cut
|
||||||
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
valid_time=0
|
||||||
if [ -z "${minute_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
echo -n "* (Default: ${minuteCutAfter}) Type how many minutes from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read minute_cutAfter
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
expr 1 + ${minute_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
if [ -z "${minute_cutAfter}" ] ; then
|
||||||
minuteCutAfter="${minuteZeroAfter}"
|
minuteZeroAfter=$(zero_number "${minuteCutAfter}")
|
||||||
fi
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${minute_cutAfter} -le 59 ] ; then
|
||||||
|
minuteZeroAfter=$(zero_number "${minute_cutAfter}")
|
||||||
|
minuteCutAfter="${minuteZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "+ Only numbers are allowed (0-59)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
# Ask for second to cut
|
# Ask for second to cut
|
||||||
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
valid_time=0
|
||||||
if [ -z "${second_cutAfter}" ] ; then
|
while [ ${valid_time} -eq 0 ] ; do
|
||||||
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
echo -n "* (Default: ${secondCutAfter}) Type how many seconds from ${hourCut}:${minuteCut}:${secondCut} (0-59): " ; read second_cutAfter
|
||||||
secondCutAfter="${secondZeroAfter}"
|
expr 1 + ${second_cutAfter} &> /dev/null
|
||||||
else
|
error_time=$?
|
||||||
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
if [ -z "${second_cutAfter}" ] ; then
|
||||||
secondCutAfter="${secondZeroAfter}"
|
secondZeroAfter=$(zero_number "${secondCutAfter}")
|
||||||
fi
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
if [ ${error_time} -eq 0 ] ; then
|
||||||
|
if [ ${second_cutAfter} -le 59 ] ; then
|
||||||
|
secondZeroAfter=$(zero_number "${second_cutAfter}")
|
||||||
|
secondCutAfter="${secondZeroAfter}"
|
||||||
|
valid_time=1
|
||||||
|
else
|
||||||
|
echo "+ Only numbers from 0 to 59 are allowed"
|
||||||
|
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