Fix bootnodes.txt processing

This commit is contained in:
Pavel Khakhulin 2017-10-11 15:46:29 +03:00
parent 0ffa891a96
commit 5075b420c2
2 changed files with 3 additions and 2 deletions

View File

@ -160,9 +160,9 @@ pull_image_and_configs() {
# curl -s -O "${INSTALL_CONFIG_REPO}/../${GENESIS_JSON}"
curl -s -o "${GENESIS_JSON}" "${GENESIS_REPO_LOC}"
curl -s -O "${INSTALL_CONFIG_REPO}/${NODE_TOML}"
curl -s -O "bootnodes.txt" "${BOOTNODES_TXT}"
curl -s -o "bootnodes.txt" "${BOOTNODES_TXT}"
sed -i "/\[network\]/a nat=\"extip:${EXT_IP}\"" ${NODE_TOML}
sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | awk -F'#' '{ print $1 }' | awk '/.+/{ if ($1) print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML}
sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | sed 's/\r$//' | awk -F'#' '{ print $1 }' | awk '/enode/{ print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML}
cat >> ${NODE_TOML} <<EOF
[misc]
logging="engine=trace,network=trace,discovery=trace"

View File

@ -168,6 +168,7 @@ pull_image_and_configs() {
curl -s -o "${GENESIS_JSON}" "${GENESIS_REPO_LOC}"
curl -s -O "${INSTALL_CONFIG_REPO}/${NODE_TOML}"
sed -i "/\[network\]/a nat=\"extip:${EXT_IP}\"" ${NODE_TOML}
sed -i "/\[network\]/a bootnodes=\[$(cat bootnodes.txt | sed 's/\r$//' | awk -F'#' '{ print $1 }' | awk '/enode/{ print "\""$1"\"" }' | paste -sd "," -)\]" ${NODE_TOML}
cat >> ${NODE_TOML} <<EOF
[misc]
logging="engine=trace,network=trace,discovery=trace"