die sed Befehle müssen weder rein. Sonst funktioniert das Script nur wenn es vom Installordner aus aufgerufen wird. Also wieder per sed die Installpfade eintragen lassen

This commit is contained in:
Leon Gaultier
2014-04-10 16:49:39 +02:00
parent 8db5d0e01f
commit 476b2e87a6
4 changed files with 249 additions and 234 deletions

View File

@ -18,7 +18,7 @@
# Programmversion
PROGNAME=`basename $0`
VERSION="0.14.99.5"
VERSION="0.14.99.6"
##### Variablen deklaration #####
# Downloadseite der Linuxinstallation
@ -63,13 +63,14 @@ func_install_noroot()
echo -e "\n\033[1;36mDie Programm-Dateien werden nach $BIN kopiert\e[m\e[m"
if [ ! -d $BIN ]; then mkdir $BIN; fi; if [ ! -d $ETC ]; then mkdir $ETC; fi; if [ ! -d $INC ]; then mkdir $INC; fi
cp calibre-autoupdate $BIN; chmod 755 $BIN"calibre-autoupdate"
sed -i "s/_-VERSION-_/${VERSION//\//\/}/g" $BIN"calibre-autoupdate" # Der Installer übergibt die Versionsnummer
sed -i "s/_-VERSION-_/${VERSION//\//\/}/g" $BIN"calibre-autoupdate" # Der Installer übergibt die Versionsnummer
func_progressbar
echo -e "\n\033[1;36mDie Header-Dateien werden nach $INC kopiert\e[m"
cp calibre-autoupdate.h calibre-autoupdate_checks.h $INC; chmod 644 $INC"calibre-autoupdate.h" $INC"calibre-autoupdate_checks.h"
func_progressbar
echo -e "\n\033[1;36mDie Konfigurations-Dateien werden nach $ETC kopiert\e[m"
cp calibre-autoupdate.conf $ETC; chmod 644 $ETC"calibre-autoupdate.conf";
sed -i "s/_-CALIBRE_INSTALL_LOCATION-_/${CALIBRE_INSTALL_LOCATION//\//\/}/g" $ETC"calibre-autoupdate.conf" # Ort der Calibreinstall
func_progressbar
return 0
}
@ -77,7 +78,7 @@ func_install_noroot()
func_install_root()
{
echo -e "\n\033[1;34mDu hast kein Schreibrecht auf $UPDATER_INSTALL_LOCATION, daher wird SUDO versucht zu verwenden...\e[m";
sudo echo -e "\n\033[1;36mProgramm-Dateien wird nach $BIN kopiert\e[m\e[m"
sudo echo -e "\n\033[1;36mDie Programm-Dateien werden nach $BIN kopiert\e[m\e[m"
if [ ! -d $BIN ]; then sudo mkdir $BIN; fi; if [ ! -d $ETC ]; then sudo mkdir $ETC; fi; if [ ! -d $INC ]; then sudo mkdir $INC; fi
sudo cp calibre-autoupdate $BIN; sudo chmod 755 $BIN"calibre-autoupdate"
sudo sed -i "s/_-VERSION-_/${VERSION//\//\/}/g" $BIN"calibre-autoupdate" # Der Installer übergibt die Versionsnummer
@ -85,8 +86,9 @@ func_install_root()
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"
func_progressbar
echo -e "\n\033[1;36mDie Konfigurations-Dateien wird nach $ETC kopiert\e[m"
echo -e "\n\033[1;36mDie Konfigurations-Dateien werden nach $ETC kopiert\e[m"
sudo cp calibre-autoupdate.conf $ETC; sudo chmod 644 $ETC"calibre-autoupdate.conf";
sudo sed -i "s/_-CALIBRE_INSTALL_LOCATION-_/${CALIBRE_INSTALL_LOCATION//\//\/}/g" $ETC"calibre-autoupdate.conf" # Ort der Calibreinstall
func_progressbar
return 0
}
@ -100,7 +102,7 @@ func_install_process() # Installiert den Calibre Updater
else
func_install_root
fi
echo -e "\n\n\033[1;36mDer Calibre-Autoupdater wurde erfolgreich installiert und"
echo -e "\n\n\033[1;34mDer Calibre-Autoupdater wurde erfolgreich installiert und"
echo -e "kann nun mit \"calibre-update\" oder \"$BIN"calibre-update"\" aufgerufen werden\e[m\n"
return 0
}