Skip to content

Commit

Permalink
handle ubuntu noble better
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Sjögren <[email protected]>
  • Loading branch information
konstruktoid committed Jul 16, 2024
1 parent 5ff997c commit 09be5d9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,20 @@ done

wait

grep config.vm.define Vagrantfile | grep -v '^#' | grep -o '".*"' | tr -d '"' |\
while read -r v; do
vagrant reload "${v}"
done

wait

for VM in $(vagrant status | grep -iE 'running.*virtualbox' | awk '{print $1}'); do
vagrant ssh "${VM}" -c 'cp /vagrant/checkScore.sh ~/'
vagrant ssh "${VM}" -c 'cp /vagrant/misc/genOSCAPreport.sh ~/'
vagrant ssh "${VM}" -c 'sudo apt-get -y update && sudo apt-get -y install bats net-tools shellcheck --no-install-recommends'
vagrant ssh "${VM}" -c 'cp -R /vagrant ~/hardening && sed -i.bak -e "s/^AUTOFILL=.*/AUTOFILL='\''Y'\''/" -e "s/^CHANGEME=.*/CHANGEME='\''changed'\''/" ~/hardening/ubuntu.cfg && cd ~/hardening && sudo bash ubuntu.sh && sudo reboot'
vagrant ssh "${VM}" -c 'cp -R /vagrant ~/hardening && sed -i.bak -e "s/^AUTOFILL=.*/AUTOFILL='\''Y'\''/" -e "s/^CHANGEME=.*/CHANGEME='\''changed'\''/" ~/hardening/ubuntu.cfg && cd ~/hardening && sudo bash ubuntu.sh && sudo shutdown -h now'
done

wait

grep config.vm.define Vagrantfile | grep -v '^#' | grep -o '".*"' | tr -d '"' |\
while read -r v; do
vagrant up --provision "${v}"
done

for VM in $(vagrant status | grep -iE 'running.*virtualbox' | awk '{print $1}'); do
while ! vagrant ssh "$VM" -c 'id'; do
echo "Waiting for $VM."
Expand Down

0 comments on commit 09be5d9

Please sign in to comment.