Skip to content

Commit

Permalink
script to patch source to only bootstrap from ipv6 nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Apr 16, 2024
1 parent c9c1a11 commit dedfa88
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,14 @@ jobs:
cat /tmp/a.sh
chmod a+rx /tmp/a.sh
- name: patch-app
- name: patch-app1
run: |
pwd
ls -al
tools/patch_src_disable_ipv4_boots.sh
git diff||echo "NO ERR"
- name: patch-app2
run: |
pwd
ls -al
Expand Down
24 changes: 24 additions & 0 deletions tools/patch_src_disable_ipv4_boots.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /bin/bash

patch_file="src/main/java/com/zoffcc/applications/sorm/BootstrapNodeEntryDB.java"

ips=$(cat src/main/java/com/zoffcc/applications/sorm/BootstrapNodeEntryDB.java |grep BootstrapNodeEntryDB_|\
grep -v '"[a-z]' |grep -v ':'|sed -e 's#^.*num_, "##g'|grep -v 'boolean udp_node_,'|awk '{print $1}'|\
sed -e 's#".*$##'|sort|uniq |sort)

hostnames=$(cat src/main/java/com/zoffcc/applications/sorm/BootstrapNodeEntryDB.java |grep BootstrapNodeEntryDB_|\
grep '"[a-z]'|sed -e 's#^.*num_, "##g'|grep -v 'boolean udp_node_,'|awk '{print $1}'|\
sed -e 's#".*$##'|sort|uniq |sort)

for i in $(echo $ips) ; do
cat "$patch_file" | grep -v "$i" > a.txt
cp a.txt "$patch_file"
rm -f a.txt
done

for i in $(echo $hostnames) ; do
cat "$patch_file" | grep -v "$i" > a.txt
cp a.txt "$patch_file"
rm -f a.txt
done

0 comments on commit dedfa88

Please sign in to comment.