Pass through the minimum password length when creating an image

This commit is contained in:
Bob Mottram 2016-06-04 17:39:26 +01:00
parent f24a136e77
commit 0e91aafbbf
3 changed files with 4 additions and 8 deletions

View File

@ -382,7 +382,8 @@ make $IMAGE_TYPE \
WIFI_PASSPHRASE="$WIFI_PASSPHRASE" \
WIFI_HOTSPOT="$WIFI_HOTSPOT" \
WIFI_NETWORKS_FILE="$WIFI_NETWORKS_FILE" \
VARIANT="$VARIANT"
VARIANT="$VARIANT" \
MINIMUM_PASSWORD_LENGTH="$MINIMUM_PASSWORD_LENGTH"
if [ ! "$?" = "0" ]; then
echo $'Build failed'

View File

@ -51,13 +51,6 @@ MY_PASSWORD="${PROJECT_NAME}"
# Minimum number of characters in a password
MINIMUM_PASSWORD_LENGTH=10
if [ -f /usr/local/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/local/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
else
if [ -f /usr/bin/${PROJECT_NAME} ]; then
MINIMUM_PASSWORD_LENGTH=$(cat /usr/bin/${PROJECT_NAME} | grep 'MINIMUM_PASSWORD_LENGTH=' | head -n 1 | awk -F '=' '{print $2}')
fi
fi
# IP address of the router (gateway)
ROUTER_IP_ADDRESS="192.168.1.254"

View File

@ -63,6 +63,7 @@ export WIFI_PASSPHRASE
export WIFI_HOTSPOT
export WIFI_NETWORKS_FILE
export VARIANT
export MINIMUM_PASSWORD_LENGTH
# Locate vmdebootstrap program fetched in Makefile
basedir=`pwd`
@ -185,6 +186,7 @@ sudo sed -i "s|WIFI_PASSPHRASE=.*|WIFI_PASSPHRASE=\"${WIFI_PASSPHRASE}\"|g" $TEM
sudo sed -i "s|WIFI_HOTSPOT=.*|WIFI_HOTSPOT=\"${WIFI_HOTSPOT}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|WIFI_NETWORKS_FILE=.*|WIFI_NETWORKS_FILE=\"${WIFI_NETWORKS_FILE}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|VARIANT=.*|VARIANT=\"${VARIANT}\"|g" $TEMP_CUSTOMISE
sudo sed -i "s|MINIMUM_PASSWORD_LENGTH=.*|MINIMUM_PASSWORD_LENGTH=\"${MINIMUM_PASSWORD_LENGTH}\"|g" $TEMP_CUSTOMISE
echo $"starting $VMDEBOOTSTRAP"
# Run vmdebootstrap script to create image