CLI options functional.

Former-commit-id: 93c2b29cef089262fc9d555c131acde0f01d4ef6
Former-commit-id: 5651fe34d260b125ca58f2683648ea62a9a9e453
This commit is contained in:
Kaj Forney 2018-09-29 16:42:16 -06:00
parent cae438497f
commit 476cba9523

View file

@ -11,52 +11,53 @@ then
exit 1
fi
#Argument check!
#Arguments
while getopts ud:r: option
do
case "${option}" in
u) UNATTEND=true;;
d) DESKTOP=${OPTARG};;
r) REPO=${OPTARG};;
u) UNATTEND="true" && echo "UNATTEND";;
d) DESKTOP=${OPTARG} && echo $DESKTOP;;
r) REPO=${OPTARG} && echo $REPO;;
esac
done
if [ $UNATTEND != "true" ];
then
whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70
DISTRO=$(lsb_release -i -s)
DESKTOP=$(whiptail --backtitle "Pentest Build Script" --title "Desktop Environment" --menu "Choose a desktop:" 15 50 6 \
"gnome" "GNOME Desktop Environment" \
"mate" "MATE Advanced Traditional Environment" \
"cinnamon" "Cinnamon Desktop Environment" \
"kde" "K Desktop Environment" \
"xfce" "Xfce Desktop Environment" \
"lxde" "Lightweight X11 Desktop Environment" 3>&1 1>&2 2>&3)
REPO=$(whiptail --backtitle "Pentest Build Script" --title "Repository" --menu "Which repository are you going to use?" 10 60 2 \
"default" "The distribution's default repository" \
"local" "A repository hosted on your local network" 3>&1 1>&2 2>&3)
if [ $REPO == "local" ];
if [ $UNATTEND != "true" ];
then
REPO=$(whiptail --backtitle "Pentest Build Script" --title "Local Repository" --inputbox "What is the IP address of your local repository?" \
10 60 3>&1 1>&2 2>&3)
fi
whiptail --backtitle "Pentest Build Script" --title "Welcome" --msgbox "This script will help you build a custom pentesting distribution." 7 70
if (whiptail --backtitle "Pentest Build Script" --title "Confirmation" --yesno "We're going to build:
Distribution: $DISTRO
Desktop Environment: $DESKTOP
Repository: $REPO
Shall we proceed?" 10 50)
then
whiptail --backtitle "Pentest Build Script" --title "Build Time!" --msgbox "This will take a while. Press OK to proceed." 8 30
else
whiptail --backtitle "Pentest Build Script" --title "OK" --msgbox "This script will now terminate." 8 35
exit 1
fi
DESKTOP=$(whiptail --backtitle "Pentest Build Script" --title "Desktop Environment" --menu "Choose a desktop:" 15 50 6 \
"gnome" "GNOME Desktop Environment" \
"mate" "MATE Advanced Traditional Environment" \
"cinnamon" "Cinnamon Desktop Environment" \
"kde" "K Desktop Environment" \
"xfce" "Xfce Desktop Environment" \
"lxde" "Lightweight X11 Desktop Environment" 3>&1 1>&2 2>&3)
REPO=$(whiptail --backtitle "Pentest Build Script" --title "Repository" --menu "Which repository are you going to use?" 10 60 2 \
"default" "The distribution's default repository" \
"local" "A repository hosted on your local network" 3>&1 1>&2 2>&3)
if [ $REPO == "local" ];
then
REPO=$(whiptail --backtitle "Pentest Build Script" --title "Local Repository" --inputbox "What is the IP address of your local repository?" \
10 60 3>&1 1>&2 2>&3)
fi
if (whiptail --backtitle "Pentest Build Script" --title "Confirmation" --yesno "We're going to build:
Distribution: $DISTRO
Desktop Environment: $DESKTOP
Repository: $REPO
Shall we proceed?" 10 50)
then
whiptail --backtitle "Pentest Build Script" --title "Build Time!" --msgbox "This will take a while. Press OK to proceed." 8 30
else
whiptail --backtitle "Pentest Build Script" --title "OK" --msgbox "This script will now terminate." 8 35
exit 1
fi
fi
#This is the stuff that's common to both distros