summaryrefslogtreecommitdiff
path: root/layout/rootfs/etc/udhcpc/bound
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-05-22 21:56:04 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-05-22 21:56:04 +0000
commit82d0f92ab8b84466ae20ab919c1f9c3577b5cecb (patch)
tree776015ae6c6a386125b2d39e13b62f91b99548f8 /layout/rootfs/etc/udhcpc/bound
downloadlh-bootstrap-82d0f92ab8b84466ae20ab919c1f9c3577b5cecb.tar.xz
Initial commit
Diffstat (limited to 'layout/rootfs/etc/udhcpc/bound')
-rwxr-xr-xlayout/rootfs/etc/udhcpc/bound25
1 files changed, 25 insertions, 0 deletions
diff --git a/layout/rootfs/etc/udhcpc/bound b/layout/rootfs/etc/udhcpc/bound
new file mode 100755
index 0000000..8b87214
--- /dev/null
+++ b/layout/rootfs/etc/udhcpc/bound
@@ -0,0 +1,25 @@
+#!/command/execlineb -P
+
+multisubstitute
+{
+ import -ui interface
+ import -ui ip
+ import -ui subnet
+ import -ui mask
+ import -ui router
+ import -ui dns
+ import -uD localdomain domain
+ import -ui lease
+}
+
+foreground
+{
+ redirfd -w 1 /run/service/udhcpc-${interface}/env/IPARG
+ s6-echo -- "-r "${ip}" "
+}
+unexport ?
+if { s6-echo "udhcpc-script: bound: ${ip}/${mask} on ${interface}, gateway ${router}, lease time ${lease}" }
+if { ip addr add ${ip}/${subnet} dev ${interface} }
+foreground { redirfd -w 2 /dev/null ip route del default }
+if { route add default gw ${router} }
+fdmove 1 3 s6-echo