diff --git a/archbox-desktop.bash b/archbox-desktop.bash index 8a2f277..7c86786 100755 --- a/archbox-desktop.bash +++ b/archbox-desktop.bash @@ -12,6 +12,15 @@ install_desktop(){ done } +checkdep(){ + which $1 >/dev/null 2>&1 || err "Install $1!" +} + +err(){ + echo "$(tput bold)$(tput setaf 1)==> $@ $(tput sgr0)" + exit 1 +} + help_text(){ cat << EOF USAGE: $0 @@ -30,7 +39,11 @@ case $1 in -h|--help) help_text ;; + -*) + err "Unknown option: $1" + ;; *) + checkdep zenity list_desktop="$(archbox ls --color=none -1 /usr/share/applications)" zenity_entry="$(echo $list_desktop | sed 's/\ /\ FALSE\ /g')" selected_entry=$(zenity --list --checklist --height=500 --width=450 \ diff --git a/archbox.bash b/archbox.bash index 88f1dc1..503f4e1 100755 --- a/archbox.bash +++ b/archbox.bash @@ -52,7 +52,7 @@ case $1 in checkdep wget while true; do wget -O archlinux.tar.gz $2 && break; done msg "Extracting the tarball..." - checkdep tar + checkdep tar tar xzf archlinux.tar.gz msg "Enabling internet connection in chroot enviroment..." cp /etc/resolv.conf $CHROOT/etc/resolv.conf