From 66cab5b6e19b3e3792b35fab2f3fa04af5d8ad11 Mon Sep 17 00:00:00 2001 From: Aaron Murray Date: Sat, 16 May 2020 09:16:39 -0500 Subject: [PATCH] skip setting network adapters if they are already in database. --- install | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/install b/install index cd8d665..a9f5e86 100755 --- a/install +++ b/install @@ -13,7 +13,7 @@ # https://github.com/armbian/config/blob/master/debian-software # https://forum.openmediavault.org/index.php/Thread/25062-Install-OMV5-on-Debian-10-Buster/ # -# version: 1.1.0 +# version: 1.1.1 # if [[ $(id -u) -ne 0 ]]; then @@ -409,7 +409,9 @@ if [ ${version} -gt 4 ]; then ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf nic="eth0" - if grep -qw "${nic}" /proc/net/dev; then + if grep -q "${nic}" ${OMV_CONFIG_FILE}; then + echo "${nic} already found in database. Skipping..." + elif grep -qw "${nic}" /proc/net/dev; then echo "Adding ${nic} to openmedivault database ..." jq --null-input --compact-output \ "{uuid: \"${OMV_CONFIGOBJECT_NEW_UUID}\", devicename: \"${nic}\", method: \"dhcp\", method6: \"dhcp\"}" | \ @@ -423,7 +425,9 @@ if [ ${version} -gt 4 ]; then fi nic="wlan0" - if grep -qw "${nic}" /proc/net/dev; then + if grep -q "${nic}" ${OMV_CONFIG_FILE}; then + echo "${nic} already found in database. Skipping..." + elif grep -qw "${nic}" /proc/net/dev; then wpaConf="/etc/wpa_supplicant/wpa_supplicant.conf" crda="/etc/default/crda"