Skip to content

Commit

Permalink
Updated the common scripts to handle the new box configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ladar committed Sep 21, 2023
1 parent feabdd1 commit b3bfa6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/common/lockout.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash -eux

# Randomize the root password and then lock the root account.
if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd1[1-3]|openbsd[6-7])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then
if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd|hardenedbsd1[1-3]|openbsd[6-7])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then

LOCKPWD=`dd if=/dev/urandom count=128 msgfmt=quiet | md5 | awk -F' ' '{print $1}'`
printf "$LOCKPWD\n$LOCKPWD\n" | passwd root

elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then
elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6]?)-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then

LOCKPWD=`dd if=/dev/urandom count=128 status=value | md5 | awk -F' ' '{print $1}'`
echo "$LOCKPWD" | pw mod user root -h 0
Expand Down
4 changes: 2 additions & 2 deletions scripts/common/zerodisk.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -ux

if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd1[1-3]|openbsd[6-7]|alpine3[5-9]|alpine31[0-8])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then
if [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(freebsd1[1-3]|hardenedbsd|hardenedbsd1[1-3]|openbsd[6-7]|alpine3[5-9]|alpine31[0-8])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then

# We fill until full so don't abort on error.
# set -ux
Expand All @@ -24,7 +24,7 @@ elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(netbsd[8-9])-(vmware|hyperv|li
sync -f /zerofill
rm -f /zerofill

elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6])-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then
elif [[ "$PACKER_BUILD_NAME" =~ ^(generic|magma)-(dragonflybsd[5-6]?)-(vmware|hyperv|libvirt|parallels|virtualbox)$ ]]; then

AVAIL=`df -m / | tail -1 | awk -F' ' '{print $4}'`
let FILL=${AVAIL}-256
Expand Down

0 comments on commit b3bfa6a

Please sign in to comment.