Adding basic script structure

This commit is contained in:
2020-03-28 20:18:41 +01:00
parent 1379a10dfd
commit 67b5efc78b
2 changed files with 24 additions and 9 deletions

View File

@@ -6,3 +6,9 @@ following targets:
- Archlinux clean install - Archlinux clean install
- Windows Subsystem for Linux 2 Arch iso (downloaded from github) - Windows Subsystem for Linux 2 Arch iso (downloaded from github)
- OS X (Because Apple) - OS X (Because Apple)
## Things to automate:
- First install all pkgs listed in *file*
- Then set run the configuration commands in *file*
- Copy the dotfiles in repository *repo*

27
xabs.sh
View File

@@ -3,28 +3,37 @@
# License: MIT # License: MIT
# #
## OPTIONS ## ## OPTIONS ##
usage() { printf "helping" && exit 1; }
while getopts "nh" o; do case "${o}" in while getopts "nt" o; do case "${o}" in
h) printf "help" && exit ;;
n) printf "user requested" && exit;; n) printf "user requested" && exit;;
t) testmode= $true;;
#*) printf "invalid option -%s\\n" "$OPTARG" && exit ;; #*) printf "invalid option -%s\\n" "$OPTARG" && exit ;;
*) usage;;
esac done esac done
## FUNCTIONS ## ## FUNCTIONS ##
installpkg(){ installpkg(){
pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ; if ["$testmode" = $true ];
} then
echo "Installing" "$1"
welcomemsg(){ else
msg = "this is a test!" echo "No test"
dialog --title "Aloha!" --msgbox "hola" 10 60 # pacman --noconfirm --needed -S "$1" >/dev/null 2>&1 ;
fi
} }
# WTF is this line for?? # WTF is this line for??
grepseq="\"^[PGA]*,\"" grepseq="\"^[PGA]*,\""
#error() {clear; printf "ERROR: \\n%s\\n" "$1"; exit;}
welcomemsg(){
dialog --title "Aloha!" --msgbox "hola" 10 60
}
## SCRIPT START ## ## SCRIPT START ##
installpkg dialog || error "Are you root and have an active internet connection?" installpkg dialog || error "Are you root and have an active internet connection?"
# Welcome everyone! # Welcome everyone!
welcomemsg || error "Exited" #welcomemsg || error "Exited"