summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2020-06-03 21:27:35 +0100
committerDavid T. Sadler <davidtsadler@googlemail.com>2020-06-03 21:27:35 +0100
commitb57cbc569fade92a4d22243a84387383a90e130f (patch)
tree1c5e7a9e9c752201ab2b3c7bbf6800745f0a587d
parent41cfa5e56467411151fccda3f46ec0f8ce95d173 (diff)
Add options and pre-install message
-rw-r--r--gohan.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/gohan.sh b/gohan.sh
index 5ab6ba0..655e21c 100644
--- a/gohan.sh
+++ b/gohan.sh
@@ -3,6 +3,18 @@
# by David T. Sadler <davidtsadler@googlemail.com>
# License: GNU GPLv3
+### OPTIONS AND VARIABLES ###
+
+while getopts ":b:p:h" o; do case "${o}" in
+ h) printf "Optional arguments for custom use:\\n -p: Dependencies and programs csv (local file or url)\\n -h: Show this message\\n" && exit ;;
+ b) repobranch=${OPTARG} ;;
+ p) progsfile=${OPTARG} ;;
+ *) printf "Invalid option: -%s\\n" "$OPTARG" && exit ;;
+esac done
+
+[ -z "$progsfile" ] && progsfile="https://raw.githubusercontent.com/davidtsadler/gohan/master/progs.csv"
+[ -z "$repobranch" ] && repobranch="master"
+
### FUNCTIONS ###
installpkg(){ pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ;}
@@ -15,6 +27,10 @@ welcomemsg() { \
dialog --colors --title "Important Note!" --yes-label "All ready!" --no-label "Return..." --yesno "Be sure the computer you are using has current pacman updates and refreshed Arch keyrings.\\n\\nIf it does not, the installation of some programs might fail." 8 70
}
+preinstallmsg() { \
+ dialog --title "Let's get this party started!" --yes-label "Let's go!" --no-label "No, nevermind!" --yesno "The rest of the installation will now be totally automated, so you can sit back and relax.\\n\\nIt will take some time, but when done, you can relax even more with your complete system.\\n\\nNow just press <Let's go!> and the system will begin installation!" 13 60 || { clear; exit; }
+ }
+
### THE ACTUAL SCRIPT ###
### This is how everything happens in an intuitive format and order.
@@ -24,3 +40,6 @@ installpkg dialog || error "Are you sure you're running this as the root user an
# Welcome user.
welcomemsg || error "User exited."
+
+# Last chance for user to back out before install.
+preinstallmsg || error "User exited."