mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-12-24 07:44:59 -07:00
CLI options functional.
This commit is contained in:
parent
57b9323b2e
commit
d855f8a752
1 changed files with 36 additions and 35 deletions
71
runme.sh
71
runme.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue