@@ -199,8 +199,9 @@ process_nfsv4_mounts()
199
199
# <IP>;<stunnel_account.file.preprod.core.windows.net.conf path>;<stunnel_account.file.preprod.core.windows.net.log path>;<stunnel_account.file.preprod.core.windows.net.pid path>;<checksumHash>;<status>;<timeout>
200
200
#
201
201
# daniewo #stunnel_account here is the destination IP address for the account.
202
+ # FSLOCATION will have FQDN IP1 IP2 or something like that. Look for IP1 and see if it's different than IP2
202
203
203
- IFS=" ;" read l_ip l_conf l_log l_pid l_checksumhash l_status l_timeout <<< " $line"
204
+ IFS=" ;" read l_ip l_conf l_log l_pid l_checksumhash l_status l_timeout <<< " $line"
204
205
205
206
if [ -z " $l_ip " -o -z " $l_conf " -o -z " $l_pid " ]; then
206
207
wecho " [FATAL] Deleting invalid line in $MOUNTMAPv4 : [$line ]!"
@@ -247,13 +248,25 @@ process_nfsv4_mounts()
247
248
# if IP is updated, then reconfigure stunnel and probably go to last step and skip this. or move this check
248
249
# above
249
250
250
- # daniewo get dest ip from mountmap file
251
- ip_address=$( echo $l_conf | awk -F' .file' ' {print $1}' )
252
- echo " The extracted IP address is: $ip_address "
251
+ # # daniewo get dest ip from mountmap file
252
+ # ip_address=$(echo $l_conf | awk -F'.file' '{print $1}')
253
+ # echo "The extracted IP address is: $ip_address"
253
254
254
255
# get matching ip address from fs location entry for the account name FQDN
255
- local fslocation_entry=$( grep -m1 $l_host $VIRTUALFSLOCATION )
256
+ local fslocation_entry=$( grep $l_ip $VIRTUALFSLOCATION )
256
257
# probably need to check if it returns empty as well.
258
+ # we grab the entire lines, for each entry etc.
259
+ for entry in $fslocation_entry ; do
260
+ eecho " daniewo fslocation_entry = $entry "
261
+
262
+ # extract fslocation entry
263
+ IFS=" " read l_fqdn old_ip new_ip l_prt <<< $fslocation_entry
264
+ eecho " daniewo $l_fqdn , $old_ip , $new_ip , $l_prt "
265
+ # if old ip != new ip, then reconfigure files
266
+ if [ " $l_ip " != " $new_ip " ]; then
267
+ eecho " daniewo -------------- IP CHANGED -----------"
268
+ fi
269
+ done
257
270
258
271
eecho " daniewo fslocation_entry = $fslocation_entry "
259
272
0 commit comments