summaryrefslogtreecommitdiffhomepage
path: root/src/pd_manager.sh
diff options
context:
space:
mode:
authorMikael Magnusson <mikma@users.sourceforge.net>2021-07-15 21:34:36 +0200
committerMikael Magnusson <mikma@users.sourceforge.net>2021-07-15 21:34:36 +0200
commitb5318d26b62432873829fc52eef4913c51ad040d (patch)
tree29276f20685becaf5aab80d6a651955698f88805 /src/pd_manager.sh
parentaad695294d09aeb74d23941744f446a2f1b17c69 (diff)
WIP pd_manager scripts
Diffstat (limited to 'src/pd_manager.sh')
-rwxr-xr-xsrc/pd_manager.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/pd_manager.sh b/src/pd_manager.sh
new file mode 100755
index 0000000..6260c3f
--- /dev/null
+++ b/src/pd_manager.sh
@@ -0,0 +1,31 @@
+#!/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 ))"
+
+output=""
+
+add_prefix() {
+ local prefix=$1
+ res="$prefix,$preferred,$valid,"
+ /bin/echo ">$res" >> ./pd_manager.log
+ output="$output$res\n"
+}
+
+read duid iaid
+read prefix res1 res2
+echo "<$duid $iaid $prefix $res1 $res2" >> ./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
+exit 0