unblock wifi even if wifi not configured

This commit is contained in:
Aaron Murray 2020-05-10 14:34:27 -05:00
parent 2cd0b93837
commit b2eda1a14c

View File

@ -417,9 +417,13 @@ if [ ${version} -gt 4 ]; then
cfg=1 cfg=1
fi fi
if [ -f "${rfkill}" ]; then
echo "Unblocking wifi with rfkill ..."
${rfkill} unblock all
fi
nic="wlan0" nic="wlan0"
if grep -qw "${nic}" /proc/net/dev; then if grep -qw "${nic}" /proc/net/dev; then
echo "Configure ${nic} ..."
wpaConf="/etc/wpa_supplicant/wpa_supplicant.conf" wpaConf="/etc/wpa_supplicant/wpa_supplicant.conf"
crda="/etc/default/crda" crda="/etc/default/crda"
@ -432,10 +436,6 @@ if [ ${version} -gt 4 ]; then
if [ -f "${crda}" ]; then if [ -f "${crda}" ]; then
awk -i inplace -F'=' -v country="$country" '/REGDOMAIN=/{$0=$1"="country} {print $0}' ${crda} awk -i inplace -F'=' -v country="$country" '/REGDOMAIN=/{$0=$1"="country} {print $0}' ${crda}
fi fi
if [ -f "${rfkill}" ]; then
echo "Unblocking wifi with rfkill ..."
${rfkill} unblock all
fi
echo "Adding ${nic} to openmedivault database ..." echo "Adding ${nic} to openmedivault database ..."
jq --null-input --compact-output \ jq --null-input --compact-output \
"{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", type: \"wireless\", method: \"dhcp\", method6: \"dhcp\", wpassid: \"${wifiName}\", wpapsk: \"${wifiPass}\"}" | \ "{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", type: \"wireless\", method: \"dhcp\", method6: \"dhcp\", wpassid: \"${wifiName}\", wpapsk: \"${wifiPass}\"}" | \