Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script to patch source to only bootstrap from ipv6 nodes #213

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Loading