Der Installer hat eine Progressbar beim kopiervorgang bekommen

This commit is contained in:
Leon Gaultier
2014-04-05 15:06:35 +02:00
parent 8a7a559186
commit a2c71cff67
2 changed files with 34 additions and 10 deletions

View File

@ -64,7 +64,7 @@ BIN=$UPDATER_INSTALL_LOCATION/bin/
func_check_dir() # Install oder Update Calibre Updater, Check ob Calibre überhaupt installiert ist
{
if test ! -d $CALIBRE_INSTALL_LOCATION/calibre ; then
echo -e "\n\033[1;31mKeine Calibre Installation unter $CALIBRE_INSTALL_LOCATION gefunden. Installation des Updaters nicht möglich.\e[m\n"; >&2
echo -e "\n\033[31mKeine Calibre Installation unter $CALIBRE_INSTALL_LOCATION gefunden. Installation des Updaters nicht möglich.\e[m\n"; >&2
exit 1
fi
@ -88,6 +88,27 @@ func_check_dir() # Install oder Update Calibre Updater, Check ob Calibre überh
fi
}
func_progressbar()
{
echo -e -n $'\033[34m------------------------------------------------------------------------- 100%\r'
echo -e -n "\033[32m0% "
for ((i=0; i<61; i++)); do
echo -e -n "\033[32m="
case $i in
15)
echo -e -n "25%" ;;
30)
echo -e -n "50%" ;;
45)
echo -e -n "75%" ;;
60)
echo -e -n " 100%" ;;
esac
sleep 0.05
done
echo -e "\e[m"
}
func_install() # Installiert den Calibre Updater
{
func_term_output
@ -115,20 +136,23 @@ func_check_dir
else
echo -e "\n\033[1;34mDu hast kein Schreibrecht auf $UPDATER_INSTALL_LOCATION, daher wird SUDO versucht zu verwenden...\e[m";
echo -e "\n\033[1;32mProgrammdatei wird nach $BIN kopiert\e[m\e[m"; sleep 3
sudo echo -e "\n\033[1;36mProgrammdatei wird nach $BIN kopiert\e[m\e[m"
sudo cp calibre-autoupdate $BIN
sudo sed -i "s/_-INC-_/${INC//\//\/}/g" $BIN"calibre-autoupdate"
sudo sed -i "s/_-ETC-_/${ETC//\//\/}/g" $BIN"calibre-autoupdate"
sudo sed -i "s/_-BIN-_/${BIN//\//\/}/g" $BIN"calibre-autoupdate"
sudo sed -i "s/_-VERSION-_/${VERSION//\//\/}/g" $BIN"calibre-autoupdate"
sudo chmod 755 $BIN"calibre-autoupdate";
echo -e "\n\033[1;32mDie Header-Dateien werden nach $INC kopiert\e[m"; sleep 3
sudo chmod 755 $BIN"calibre-autoupdate"
func_progressbar
echo -e "\n\033[1;36mDie Header-Dateien werden nach $INC kopiert\e[m"
sudo cp calibre-autoupdate.h calibre-autoupdate_checks.h $INC
sudo chmod 644 $INC"calibre-autoupdate.h" $INC"calibre-autoupdate_checks.h";
echo -e "\n\033[1;32mDie Konfigurationsdatei wird nach $ETC kopiert\e[m"; sleep 3
sudo chmod 644 $INC"calibre-autoupdate.h" $INC"calibre-autoupdate_checks.h"
func_progressbar
echo -e "\n\033[1;36mDie Konfigurationsdatei wird nach $ETC kopiert\e[m"
sudo cp calibre-autoupdate.conf $ETC
sudo sed -i "s/_-CALIBRE_INSTALL_LOCATION-_/${CALIBRE_INSTALL_LOCATION//\//\/}/g" $ETC"calibre-autoupdate.conf"
sudo chmod 644 $ETC"calibre-autoupdate.conf";
func_progressbar
fi
echo -e "\n\n\n\033[1;36mDer Calibre-Autoupdater wurde erfolgreich installiert und"
echo -e "kann nun mit calibre-update oder $BIN"calibre-update" aufgerufen werden\e[m\n"