Fix indent

This commit is contained in:
q3aql 2021-03-12 17:53:15 +01:00
parent 03a69bcbae
commit 02ee017d16

View File

@ -26,16 +26,16 @@ NAME_APP_DOWNLOAD="x"
function rootMessage() { function rootMessage() {
mkdir -p /etc/root &> /dev/null mkdir -p /etc/root &> /dev/null
administrator=$? administrator=$?
if [ ${administrator} -eq 0 ] ; then if [ ${administrator} -eq 0 ] ; then
rm -rf /etc/root rm -rf /etc/root
else else
echo "" echo ""
echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)" echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)"
echo "" echo ""
echo "+ Root permissions are required!" echo "+ Root permissions are required!"
echo "" echo ""
exit exit
fi fi
} }
# Function to detect "kernel" name # Function to detect "kernel" name
@ -58,22 +58,22 @@ function archCheck() {
archs=`uname -m` archs=`uname -m`
case "$archs" in case "$archs" in
i?86) i?86)
ARCH=i686 ARCH=i686
;; ;;
x86_64) x86_64)
ARCH=amd64 ARCH=amd64
;; ;;
*) *)
echo "" echo ""
echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)" echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)"
echo "" echo ""
echo "+ Unsupported Arquitecture ($archs)" echo "+ Unsupported Arquitecture ($archs)"
echo "" echo ""
exit exit
esac esac
} }
# Function to check if 'curl' is installed. # Function to check if 'curl' is installed.
function curlCheck () { function curlCheck () {
curl --help &> /dev/null curl --help &> /dev/null
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
@ -87,26 +87,26 @@ function curlCheck () {
exit exit
fi fi
} }
# Function to check available downloaders (wget, axel or aria2c). # Function to check available downloaders (wget, axel or aria2c).
function checkDownloader() { function checkDownloader() {
# Check wget installed # Check wget installed
wget --help &> /dev/null wget --help &> /dev/null
checkWget="$?" checkWget="$?"
# Check axel installed # Check axel installed
axel --help &> /dev/null axel --help &> /dev/null
checkAxel="$?" checkAxel="$?"
# Check aria2c installed # Check aria2c installed
aria2c --help &> /dev/null aria2c --help &> /dev/null
checkAria2="$?" checkAria2="$?"
# Check variables # Check variables
if [ ${checkAria2} -eq 0 ] ; then if [ ${checkAria2} -eq 0 ] ; then
APP_DOWNLOAD='aria2c --check-certificate=false' APP_DOWNLOAD='aria2c --check-certificate=false'
NAME_APP_DOWNLOAD="aria2c" NAME_APP_DOWNLOAD="aria2c"
elif [ ${checkAxel} -eq 0 ] ; then elif [ ${checkAxel} -eq 0 ] ; then
APP_DOWNLOAD='axel' APP_DOWNLOAD='axel'
NAME_APP_DOWNLOAD="axel" NAME_APP_DOWNLOAD="axel"
elif [ ${checkWget} -eq 0 ] ; then elif [ ${checkWget} -eq 0 ] ; then
APP_DOWNLOAD='wget -c' APP_DOWNLOAD='wget -c'
NAME_APP_DOWNLOAD="wget" NAME_APP_DOWNLOAD="wget"
elif [ "x${APP_DOWNLOAD}" = "x" ] ; then elif [ "x${APP_DOWNLOAD}" = "x" ] ; then
@ -129,80 +129,78 @@ checkDownloader
# Sintax to install, update and uninstall FFmpeg. # Sintax to install, update and uninstall FFmpeg.
case ${1} in case ${1} in
--install|-install|--update|-update) --install|-install|--update|-update)
cd ${TMP_DIR} cd ${TMP_DIR}
rm -rf ffmpeg-* rm -rf ffmpeg-*
echo "" echo ""
echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)" echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)"
echo "" echo ""
if [ "${2}" == "release" ] ; then if [ "${2}" == "release" ] ; then
curl ${URL} | grep "${URL_RELEASES}" | cut -d '"' -f 2 | grep "${ARCH}" | head -1 > $TMP_DIR/ffmpeg-url curl ${URL} | grep "${URL_RELEASES}" | cut -d '"' -f 2 | grep "${ARCH}" | head -1 > $TMP_DIR/ffmpeg-url
if [ "$?" -eq 0 ] ; then if [ "$?" -eq 0 ] ; then
echo "OK" > /dev/null echo "OK" > /dev/null
else
echo "+ Connection problem!"
echo "* Exiting..."
exit
fi
else else
curl ${URL} | grep "${URL_BUILDS}" | cut -d '"' -f 2 | grep "${ARCH}" | head -1 > $TMP_DIR/ffmpeg-url echo "+ Connection problem!"
if [ "$?" -eq 0 ] ; then echo "* Exiting..."
echo "OK" > /dev/null exit
else
echo "+ Connection problem!"
echo "* Exiting..."
exit
fi
fi fi
URL_PACKAGE=`cat $TMP_DIR/ffmpeg-url` else
NAME_PACKAGE=`cat /tmp/ffmpeg-url | cut -d "/" -f 6` curl ${URL} | grep "${URL_BUILDS}" | cut -d '"' -f 2 | grep "${ARCH}" | head -1 > $TMP_DIR/ffmpeg-url
#clear if [ "$?" -eq 0 ] ; then
echo "* Downloading ${NAME_PACKAGE} (${NAME_APP_DOWNLOAD})" echo "OK" > /dev/null
${APP_DOWNLOAD} ${URL_PACKAGE} else
if [ "$?" -eq 0 ] ; then echo "+ Connection problem!"
echo "OK" > /dev/null echo "* Exiting..."
else exit
echo "" fi
echo "+ Connection problem!" fi
echo "* Exiting..." URL_PACKAGE=`cat $TMP_DIR/ffmpeg-url`
exit NAME_PACKAGE=`cat /tmp/ffmpeg-url | cut -d "/" -f 6`
fi #clear
tar Jxvf ${NAME_PACKAGE} echo "* Downloading ${NAME_PACKAGE} (${NAME_APP_DOWNLOAD})"
rm -f ffmpeg-url ffmpeg*xz ${APP_DOWNLOAD} ${URL_PACKAGE}
cd ffmpeg-* if [ "$?" -eq 0 ] ; then
cp -rfv ffmpeg ${PATH_INSTALL} echo "OK" > /dev/null
cp -rfv ffprobe ${PATH_INSTALL} else
cd .. echo ""
rm -rf ffmpeg-* echo "+ Connection problem!"
echo "* Finished!" echo "* Exiting..."
exit exit
fi
tar Jxvf ${NAME_PACKAGE}
rm -f ffmpeg-url ffmpeg*xz
cd ffmpeg-*
cp -rfv ffmpeg ${PATH_INSTALL}
cp -rfv ffprobe ${PATH_INSTALL}
cd ..
rm -rf ffmpeg-*
echo "* Finished!"
exit
;; ;;
--uninstall|-uninstall) --uninstall|-uninstall)
echo "" echo ""
echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)" echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)"
echo "" echo ""
echo "* Uninstalling FFmpeg..." echo "* Uninstalling FFmpeg..."
sleep 3 sleep 3
rm -rfv /usr/bin/ffmpeg rm -rfv /usr/bin/ffmpeg
rm -rfv /usr/bin/ffprobe rm -rfv /usr/bin/ffprobe
echo "* Finished!" echo "* Finished!"
;; ;;
--help|-help|-h|*) --help|-help|-h|*)
echo "" echo ""
echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)" echo "* ffmpeg-install ${VERSION} (${M_DATE}) (GPL v2.0)"
echo "" echo ""
echo "* Script: q3aql (q3aql@protonmail.ch)" echo "* Script: q3aql (q3aql@protonmail.ch)"
echo "* Builds: John Van Sickle (john.vansickle@gmail.com)" echo "* Builds: John Van Sickle (john.vansickle@gmail.com)"
echo "" echo ""
echo "+ Sintax:" echo "+ Sintax:"
echo "" echo ""
echo " $ ffmpeg-install --install --> Install FFmpeg (Git version)" echo " $ ffmpeg-install --install --> Install FFmpeg (Git version)"
echo " $ ffmpeg-install --install release --> Install FFmpeg (Stable version)" echo " $ ffmpeg-install --install release --> Install FFmpeg (Stable version)"
echo " $ ffmpeg-install --update --> Update FFmpeg (Git version)" echo " $ ffmpeg-install --update --> Update FFmpeg (Git version)"
echo " $ ffmpeg-install --update release --> Update FFmpeg (Stable version)" echo " $ ffmpeg-install --update release --> Update FFmpeg (Stable version)"
echo " $ ffmpeg-install --uninstall --> Uninstall FFmpeg previously installed" echo " $ ffmpeg-install --uninstall --> Uninstall FFmpeg previously installed"
echo " $ ffmpeg-install --help --> Show help" echo " $ ffmpeg-install --help --> Show help"
echo "" echo ""
exit exit
esac esac