From 719273b4c35b1c7557c99354c1d2577b00537af0 Mon Sep 17 00:00:00 2001 From: farhan Date: Mon, 28 Feb 2022 15:44:35 +0000 Subject: [PATCH] background checks 2 --- scripts/startup.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/startup.sh b/scripts/startup.sh index 9fe88a9..50aa0a1 100755 --- a/scripts/startup.sh +++ b/scripts/startup.sh @@ -34,8 +34,25 @@ docker_check() { fi } +arch_check() { + if [[ ! -e /etc/arch-release ]]; then + echo -ne "ERROR! This script must be run in Arch Linux!\n" + exit 0 + fi +} + +pacman_check() { + if [[ -f /var/lib/pacman/db.lck ]]; then + echo "ERROR! Pacman is blocked." + echo -ne "If not running remove /var/lib/pacman/db.lck.\n" + exit 0 + fi +} + background_checks() { root_check + arch_check + pacman_check docker_check } # Renders a text based list of options that can be selected by the