From 040ba18f7fd17b4d6dc3a93549a19263fb0b8a95 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Tue, 31 Jul 2018 22:57:08 +0100 Subject: amended check for existing nodes --- burrow | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/burrow b/burrow index 4ac35fd..2665d21 100755 --- a/burrow +++ b/burrow @@ -43,7 +43,7 @@ retrieve_selector(){ SEL=$(echo "$1" | cut -d "|" -f 2) HOST=$(echo "$1" | cut -d "|" -f 3) PORT=$(echo "$1" | cut -d "|" -f 4) - printf "${SEL}\r\n" | netcat -w 15 "${HOST}" "${PORT}" + printf "${SEL}\r\n" | netcat -w 5 "${HOST}" "${PORT}" } @@ -56,7 +56,16 @@ retrieve_selector(){ check_selector_present(){ sel_id="$1" sel_dir="$(echo ${sel_id} | cut -c -2)" - [ -d "${sel_dir}" -a -f "${sel_dir}/${sel_id}" ] && cat ${sel_dir}/${sel_id} && echo ${sel_id}>>present && exit 1 + [ -d "${sel_dir}" -a -f "${sel_dir}/${sel_id}" ] && exit +## { + ## if at least one of the neighbours of sel_id is missing, cat the entire list of + ## neighbours to be re-visited and exit +## for i in $(cat ${sel_dir}/${sel_id}); do +## i_dir="$(echo ${i} | cut -c -2)" +## [ ! -f ${i_dir}/${i} ] && cat "${sel_dir}/${sel_id}" && break +## done +## exit +## } [ ! -d "${sel_dir}" ] && mkdir -p "${sel_dir}" } -- cgit v1.2.3