diff options
author | KatolaZ <katolaz@freaknet.org> | 2018-07-31 22:57:08 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2018-07-31 22:57:08 +0100 |
commit | 040ba18f7fd17b4d6dc3a93549a19263fb0b8a95 (patch) | |
tree | 62e3bb2484b7f6068da8a3c38cd0cadbbe209275 | |
parent | 06eee070651f69769fd6f8feb57950515c4a1150 (diff) |
amended check for existing nodes
-rwxr-xr-x | burrow | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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}" } |