diff --git a/Einrichter-CLI.sh b/Einrichter-CLI.sh index dd0ecb1..bc50e5d 100644 --- a/Einrichter-CLI.sh +++ b/Einrichter-CLI.sh @@ -4,24 +4,54 @@ then echo "Please run Einrichter (TylkoLinux) using administrative permissions." exit fi +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +EINRICHTER_VER=0.1.0 + function main() { } function einrichter.installer.pkgs() { - echo "[1/ ] Downloading package list..." + echo "M: Preparing TylkoLinux for installation..." + mkdir $LFS/sources + echo "[1/6] Downloading package list..." wget https://www.linuxfromscratch.org/lfs/view/stable-systemd/wget-list-systemd --continue --directory-prefix=$LFS/sources - echo "[2/ ] Downloading checksum of packages" + echo "[2/6] Downloading checksum of packages" wget https://www.linuxfromscratch.org/lfs/view/stable-systemd/md5sums --continue --directory-prefix=$LFS/sources - echo "[3/ ] Installing packages + echo "[3/6] Download packages..." wget --input-file=wget-list-systemd --continue --directory-prefix=$LFS/sources + echo "[4/6] Verifying packages..." pushd $LFS/sources - md5sum -c md5sums + function einrichter.installer.pkgs.verify() { + md5sum -c $LFS/sources/md5sums || FAILURE_CODE=ec12737 + } + einrichter.installer.pkgs.verify || einrichter.installer.fail + popd + echo "[5/6] Downloading patches..." + mkdir $LFS/sources/patches + wget --input-file=lfs-patch-list --continue --directory-prefix=$LFS/sources/patches + echo "[6/6] Verifying patches..." + pushd $LFS/sources/patches + function einrichter.installer.pkgs.verify.patches() { + md5sum -c $SCRIPT_DIR/lfs-patch-list-checksum || FAILURE_CODE=ec12737 + } + einrichter.installer.pkgs.verify.patches || einrichter.installer.fail popd } function einrichter.installer.bg() { } + +function einrichter.installer.fail() { + case "$FAILURE_CODE" in + "ec12737") + echo "E: The verification of the packages has failed. This could be an issue on either your side of the Installer's. Please report this error to the github.com/kevadesu/TylkoLinux repository." + ;; + *) + echo "E: The installation failed due to an unknown error." + ;; + esac +} main