Optimized the installation script

This commit is contained in:
Mathias
2022-08-09 01:43:52 +02:00
parent 905af151db
commit 3dcbeffb26

View File

@@ -58,48 +58,21 @@ apt-get update -y
clear
echo -e "$GREEN Info:$NORMAL Die Installation wird jetzt vorbereitet. Das kann einen Augenblick dauern..."
sleep 5
# Check for wget
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob wget vorhanden ist..."
if ! command -v wget &> /dev/null
then
echo -e "$YELLOW \"wget\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install wget -y
fi
# Check for unzip
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob unzip vorhanden ist..."
if ! command -v unzip &> /dev/null
then
echo -e "$YELLOW \"unzip\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install unzip -y
fi
# Check for build essential
clear
if [ "$1" == "--beta" ]; then
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob build-essential vorhanden ist..."
if ! dpkg-query -l build-essential | grep build-essential &> /dev/null
function check() {
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob $1 vorhanden ist..."
if ! command -v "$1" &> /dev/null
then
echo -e "$YELLOW \"build-essential\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
echo -e "$YELLOW \"$1\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install build-essential -y
apt-get install "$1" -y
fi
fi
}
# Check for curl
clear
echo -e "$BLUE🔎 Status:$NORMAL Überprüfe, ob curl vorhanden ist..."
if ! command -v curl &> /dev/null
then
echo -e "$YELLOW \"curl\" ist nicht installiert.$NORMAL Die Installation wurde gestartet..."
sleep 2
apt-get install curl -y
fi
check "wget"
check "unzip"
check "curl"
# Check for node
clear
@@ -125,14 +98,14 @@ echo -e "$GREEN✓ Vorbereitung abgeschlossen:$NORMAL Die Installation von MySpe
sleep 3
clear
if [ ! -d $INSTALLATION_PATH ]
if [ ! -d "$INSTALLATION_PATH" ]
then
echo -e "$BLUE Info: $NORMAL MySpeed wird unter dem Verzeichnis $INSTALLATION_PATH installiert. Der Ordner wird nun erstellt."
sleep 2
mkdir $INSTALLATION_PATH
mkdir "$INSTALLATION_PATH"
fi
cd $INSTALLATION_PATH
cd "$INSTALLATION_PATH"
echo -e "$BLUE Info: $NORMAL Die aktuelle MySpeed-Instanz wird heruntergeladen. Einen Moment..."
sleep 2