Completion file may not exist on the mesh
This commit is contained in:
parent
673a79bdcf
commit
7c60112537
|
@ -42,23 +42,22 @@ if [[ $1 == "start" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Mesh definition
|
# Mesh definition
|
||||||
WIFI_SSID=
|
|
||||||
if ! grep -q "WIFI_SSID:" $COMPLETION_FILE; then
|
|
||||||
WIFI_SSID='mesh'
|
WIFI_SSID='mesh'
|
||||||
else
|
if [ -f $COMPLETION_FILE ]; then
|
||||||
|
if grep -q "WIFI_SSID:" $COMPLETION_FILE; then
|
||||||
WIFI_SSID=$(cat $COMPLETION_FILE | grep "WIFI_SSID:" | awk -F ':' '{print $2}')
|
WIFI_SSID=$(cat $COMPLETION_FILE | grep "WIFI_SSID:" | awk -F ':' '{print $2}')
|
||||||
fi
|
fi
|
||||||
sed -i "s|WIFI_SSID:.*|WIFI_SSID:${WIFI_SSID}|g" $COMPLETION_FILE
|
sed -i "s|WIFI_SSID:.*|WIFI_SSID:${WIFI_SSID}|g" $COMPLETION_FILE
|
||||||
|
fi
|
||||||
CELLID='any'
|
CELLID='any'
|
||||||
|
|
||||||
CHANNEL=
|
|
||||||
if ! grep -q "Wifi channel:" $COMPLETION_FILE; then
|
|
||||||
CHANNEL=2
|
CHANNEL=2
|
||||||
else
|
if [ -f $COMPLETION_FILE ]; then
|
||||||
|
if grep -q "Wifi channel:" $COMPLETION_FILE; then
|
||||||
CHANNEL=$(cat $COMPLETION_FILE | grep "Wifi channel:" | awk -F ':' '{print $2}')
|
CHANNEL=$(cat $COMPLETION_FILE | grep "Wifi channel:" | awk -F ':' '{print $2}')
|
||||||
fi
|
fi
|
||||||
sed -i "s|Wifi channel:.*|Wifi channel:${CHANNEL}|g" $COMPLETION_FILE
|
sed -i "s|Wifi channel:.*|Wifi channel:${CHANNEL}|g" $COMPLETION_FILE
|
||||||
|
fi
|
||||||
|
|
||||||
ZERONET_PORT=15441
|
ZERONET_PORT=15441
|
||||||
IPFS_PORT=4001
|
IPFS_PORT=4001
|
||||||
|
|
Loading…
Reference in New Issue