summaryrefslogtreecommitdiffhomepage
path: root/src/pd_manager.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/pd_manager.sh')
-rwxr-xr-xsrc/pd_manager.sh24
1 files changed, 9 insertions, 15 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