Skip to content

Commit

Permalink
Improve configure_wifi.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
roleoroleo committed Mar 17, 2022
1 parent 876c169 commit 6e0fe8c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/static/static/home/yi-hack/script/configure_wifi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,16 @@ fi

CURRENT_SSID=$(dd bs=1 skip=28 count=64 if=/dev/mtdblock6 2>/dev/null)
CURRENT_KEY=$(dd bs=1 skip=92 count=64 if=/dev/mtdblock6 2>/dev/null)
CONNECTED_BIT=$(hexdump -s 24 -n 4 -v /dev/mtdblock6 | awk 'FNR <=1' | awk '{print $3$2}')

echo $SSID ${#SSID} - $CURRENT_SSID ${#CURRENT_SSID}
echo $KEY ${#KEY} - $CURRENT_KEY ${#CURRENT_KEY}

if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ]; then
if [ "$SSID" == "$CURRENT_SSID" ] && [ "$KEY" == "$CURRENT_KEY" ] && [ "$CONNECTED_BIT" == "00000000" ]; then
echo "ssid and key already configured"
exit
if [ $# -ne 1 ] || [ "$1" != "force" ]; then
exit
fi
fi

echo "creating partition backup..."
Expand Down

0 comments on commit 6e0fe8c

Please sign in to comment.