Browse Source

Pass through the minimum password length when creating an image

Bob Mottram 8 years ago
parent
commit
0e91aafbbf
3 changed files with 4 additions and 8 deletions
  1. 2
    1
      src/freedombone-image
  2. 0
    7
      src/freedombone-image-customise
  3. 2
    0
      src/freedombone-image-make

+ 2
- 1
src/freedombone-image View File

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

+ 0
- 7
src/freedombone-image-customise View File

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

+ 2
- 0
src/freedombone-image-make View File

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