diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-07-15 21:35:20 +0200 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-07-15 21:35:20 +0200 |
commit | 5784fe6123dc17d8005e1e1c9cdb4de4c3f80d3f (patch) | |
tree | 937aa22ccf7310eb6203a23aae17803c0b68b005 | |
parent | b5318d26b62432873829fc52eef4913c51ad040d (diff) |
WIP pd_manager updatepd-manager
-rwxr-xr-x | src/pd_manager.sh | 24 | ||||
-rwxr-xr-x | src/pd_manager_run.sh | 3 |
2 files changed, 11 insertions, 16 deletions
diff --git a/src/pd_manager.sh b/src/pd_manager.sh index 6260c3f..3cbf72a 100755 --- a/src/pd_manager.sh +++ b/src/pd_manager.sh @@ -1,31 +1,25 @@ #!/bin/sh -delay=0.05 IFS="," -hour="$(( 3600 ))" -day="$(( 24 * $hour ))" -#preferred="$(( 5 * $hour ))" -#valid="$(( $preferred + 10 * $hour ))" -preferred="$(( 1 * $day ))" -valid="$(( $preferred + 1 * $day ))" +day="$(( 3600 * 24 ))" +preferred="$(( $day ))" +valid="$(( $preferred + $day ))" output="" -add_prefix() { +write_prefix() { local prefix=$1 res="$prefix,$preferred,$valid," - /bin/echo ">$res" >> ./pd_manager.log + echo ">$res" >> /root/pd_manager.log output="$output$res\n" } read duid iaid read prefix res1 res2 -echo "<$duid $iaid $prefix $res1 $res2" >> ./pd_manager.log +echo "<$duid $iaid $prefix $res1 $res2" >> /root/pd_manager.log -sleep $delay -add_prefix "2001:0470:de6f:1234::/64" -add_prefix "2001:0470:de17:1234::/64" -/bin/echo -e -n "$output\n\n" -sleep $delay +write_prefix "2001:0470:de6f:1234::/64" +write_prefix "2001:0470:de17:1234::/64" +echo -e -n "$output\n\n" exit 0 diff --git a/src/pd_manager_run.sh b/src/pd_manager_run.sh index 53ab4c6..5ef0a05 100755 --- a/src/pd_manager_run.sh +++ b/src/pd_manager_run.sh @@ -1,4 +1,5 @@ #!/bin/sh -socat -v TCP-LISTEN:1234,reuseport,fork EXEC:./pd_manager.sh +socat UNIX-LISTEN:/tmp/pd_manager,fork EXEC:/root/pd_manager.sh +#socat -v UNIX-LISTEN:/tmp/pd_manager,fork TCP-CONNECT:10.49.160.1:1234 |