summaryrefslogtreecommitdiff
path: root/layout/rootfs/etc/udhcpc/bound
blob: c6a5748048eba37c4be4f8d33e491823e31828ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/command/execlineb -P

multisubstitute
{
  importas -ui interface interface
  importas -ui ip ip
  importas -ui subnet subnet
  importas -ui mask mask
  importas -ui router router
  importas -ui dns dns
  importas -uD localdomain domain domain
  importas -ui lease 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