Skip to content

Commit

Permalink
improving readability ...
Browse files Browse the repository at this point in the history
  • Loading branch information
scuzzilla committed Feb 5, 2021
1 parent 08495cc commit 8362d8b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tools/nc_schemas_extract/nc_schemas_extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ gen_capabilities_yangs() {
echo -e "${host}"
local cap_list=$("${nc}" --host "${host}" --port "${port}" -u "${username}" -p "${password}" --hello | \
awk -F "module=" '{print $2}' | awk -F "&amp|</nc" '{print $1}' 2> /dev/null)
# local cap_deviations=$("${nc}" --host "${host}" --port "${port}" -u "${username}" -p "${password}" \
# --timeout 30 --reply-timeout 30 --hello | awk -F "deviations=" '{print $2}' | awk -F "<" '{print $1}' 2> /dev/null)
# local cap_deviations=$("${nc}" --host "${host}" --port "${port}" -u "${username}" -p "${password}" --hello | \
# awk -F "deviations=" '{print $2}' | awk -F "<" '{print $1}' 2> /dev/null)

if [[ ! -d "${work_dir}/capabilities_yangs/${host}" ]]; then
mkdir -p "${work_dir}/capabilities_yangs/${host}"
Expand All @@ -123,14 +123,15 @@ gen_capabilities_yangs() {
do
echo -e "YANG - Extracting ${yang} from ${host} ..."
$("${nc}" --host "${host}" --port "${port}" -u "${username}" -p "${password}" \
--get-schema "${yang}" | awk -v RS='<[^>]+>' -v ORS= '1' > "${work_dir}/capabilities_yangs/${host}/${yang}.yang")
--get-schema "${yang}" | awk -v RS='<[^>]+>' -v ORS= '1' > \
"${work_dir}/capabilities_yangs/${host}/${yang}.yang")
done

# for yang in $cap_deviations
# do
# echo -e "YANG Deviations - Extracting ${yang} from ${host} ..."
# $("${nc}" --host "${host}" --port "${port}" -u "${username}" -p "${password}" \
# --timeout 30 --reply-timeout 30 --get-schema "${yang}" > "${work_dir}/capabilities_yangs/${host}/${yang}.yang")
# --get-schema "${yang}" > "${work_dir}/capabilities_yangs/${host}/${yang}.yang")
# done
done < "${f_arg}"
}
Expand Down

0 comments on commit 8362d8b

Please sign in to comment.