From 0e91aafbbf9220e86a36fbb31c60ce69ba9ce916 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 4 Jun 2016 17:39:26 +0100 Subject: [PATCH] Pass through the minimum password length when creating an image --- src/freedombone-image | 3 ++- src/freedombone-image-customise | 7 ------- src/freedombone-image-make | 2 ++ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/freedombone-image b/src/freedombone-image index 6186f195..c36d72bb 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -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' diff --git a/src/freedombone-image-customise b/src/freedombone-image-customise index 0ae29031..401171dc 100755 --- a/src/freedombone-image-customise +++ b/src/freedombone-image-customise @@ -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" diff --git a/src/freedombone-image-make b/src/freedombone-image-make index 78fcb2fe..e79f3ad9 100755 --- a/src/freedombone-image-make +++ b/src/freedombone-image-make @@ -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