skip setting config flag if it failed to add nic to database

This commit is contained in:
Aaron Murray 2020-09-03 11:49:15 -05:00
parent 02e4268dd6
commit 48910ac9eb

10
install
View File

@ -13,7 +13,7 @@
# https://github.com/armbian/config/blob/master/debian-software # https://github.com/armbian/config/blob/master/debian-software
# https://forum.openmediavault.org/index.php/Thread/25062-Install-OMV5-on-Debian-10-Buster/ # https://forum.openmediavault.org/index.php/Thread/25062-Install-OMV5-on-Debian-10-Buster/
# #
# version: 1.2.5 # version: 1.2.6
# #
if [[ $(id -u) -ne 0 ]]; then if [[ $(id -u) -ne 0 ]]; then
@ -449,7 +449,9 @@ if [ ${version} -gt 4 ] && [ ${skipNet} -ne 1 ]; then
jq --null-input --compact-output \ jq --null-input --compact-output \
"{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", type: \"wifi\", method: \"dhcp\", method6: \"dhcp\", wpassid: \"${wifiName}\", wpapsk: \"${wifiPass}\"}" | \ "{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", type: \"wifi\", method: \"dhcp\", method6: \"dhcp\", wpassid: \"${wifiName}\", wpapsk: \"${wifiPass}\"}" | \
omv-confdbadm update "conf.system.network.interface" - omv-confdbadm update "conf.system.network.interface" -
cfg=1 if grep -q "<devicename>${nic}</devicename>" ${OMV_CONFIG_FILE}; then
cfg=1
fi
fi fi
fi fi
else else
@ -457,7 +459,9 @@ if [ ${version} -gt 4 ] && [ ${skipNet} -ne 1 ]; then
jq --null-input --compact-output \ jq --null-input --compact-output \
"{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", method: \"dhcp\", method6: \"dhcp\"}" | \ "{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", method: \"dhcp\", method6: \"dhcp\"}" | \
omv-confdbadm update "conf.system.network.interface" - omv-confdbadm update "conf.system.network.interface" -
cfg=1 if grep -q "<devicename>${nic}</devicename>" ${OMV_CONFIG_FILE}; then
cfg=1
fi
fi fi
done done