Skip to content

Commit 30ec469

Browse files
committed
Fix length testing for SSID. Issue #41.
1 parent 939e603 commit 30ec469

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/changewifisettings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ sed -i "/^channel=/c\channel=$NEWCHANNEL" "$CONFIGFILE"
5151
# Validate new SSID. Replace it with 'MoodleBox' if invalid.
5252
# At this point, $NEWSSID is a string of hex values, e.g. "74657374" for "test"
5353
# We want to check that it is valid, and between 8 and 32 bytes.
54-
[[ $NEWSSID =~ ^([0-9a-fA-F]{2}){8,32}$ ]] || NEWSSID="4d6f6f646c65426f78" # "MoodleBox"
54+
[[ $NEWSSID =~ ^([0-9a-fA-F]{2}){1,32}$ ]] || NEWSSID="4d6f6f646c65426f78" # "MoodleBox"
5555
# New SSID is now valid; set it in config file.
5656
# Change ssid to ssid2
5757
sed -i "/^ssid=/c\ssid2=$NEWSSID" "$CONFIGFILE"

0 commit comments

Comments
 (0)