From a4cb9fc97760aed39493af22279c3dcf7a07fa9b Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Fri, 25 Jan 2019 00:19:04 -0700 Subject: [PATCH] Quality of life update. Actually error out if no .iso is created, keep build logs in a logs folder, and add a timestamp to the finished files. Former-commit-id: b4d4430792851f1b591fae451af1139aa83af26c Former-commit-id: 95f60dc40903d3cccfb755f8cc25f8e5fc629db1 --- README.md | 2 +- logs/.gitignore | 4 ++++ runme.sh | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 logs/.gitignore diff --git a/README.md b/README.md index b330db16..cbd80833 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Clone this repository with `git clone --recursive`, then make whatever changes y * Add any extra software from the repository you wish to install to the config/software.list.chroot file. * Add any commands you want to have run during the build process to the config/pentest-distro-builder.chroot file. -When you're ready to build, run `sudo ./runme.sh` . Once it's complete, the finished image will be copied to the images/ folder. +When you're ready to build, run `sudo ./runme.sh` . Once it's complete, the finished image will be copied to the images/ folder, and a log file will be created in the logs/ folder. If you run the script without any options, it will build whichever OS you are currently running, and prompt for which desktop environment and repository you wish to use. If you wish, however, you can manually specify these options instead (for example, to script an image to be built nightly or weekly): diff --git a/logs/.gitignore b/logs/.gitignore new file mode 100644 index 00000000..5e7d2734 --- /dev/null +++ b/logs/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/runme.sh b/runme.sh index a1f23337..73b69fb4 100755 --- a/runme.sh +++ b/runme.sh @@ -83,7 +83,8 @@ Kali) cd build/live-build-config ./build.sh --distribution kali-rolling --variant $DESKTOP --verbose - cp images/*.iso ../../images/kali-rolling-$DESKTOP-$(date -I).iso + cp images/*.iso ../../images/kali-rolling-$DESKTOP-$(date -I)-$(date +%H%M).iso + cp build.log ../../logs/kali-rolling-$DESKTOP-$(date -I)-$(date +%H%M).log ;; Parrot) cp -rv ./modules/parrot-build ./build/ @@ -101,13 +102,21 @@ Parrot) cd build/parrot-build ./build.sh build variant-$DESKTOP amd64 - cp ../*.iso ../../images/parrotsec-$DESKTOP-$(date -I).iso + cp ../*.iso ../../images/parrotsec-$DESKTOP-$(date -I)-$(date +%H%M).iso + cp buildlog.log ../../logs/parrotsec-$DESKTOP-$(date -I)-$(date +%H%M).log ;; esac if [[ $UNATTEND != "true" ]]; then -whiptail --backtitle "Pentest Build Script" --title "Finished" --msgbox "Fingers crossed there were no errors... Your image should be done!" 7 70 + if [ -f ../../images/parrotsec-$DESKTOP-$(date -I).iso ]; + then + whiptail --backtitle "Pentest Build Script" --title "Finished" \ + --msgbox "Fingers crossed there were no errors... Your image should be done!" 7 70 + else + whiptail --backtitle "Pentest Build Script" --title "OH NO" \ + --msgbox "Something went wrong and no .iso file was created... Check the log file for details! :-(" 7 92 + fi fi exit 0