oci-runner 0.1.7

A tiny foreground libcontainer runtime and CLI
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/busybox sh
# udhcpc calls this with bound, renew, or deconfig.
# BusyBox exports the dotted netmask as `subnet`.
case "$1" in
    bound|renew)
        netmask=${subnet:-255.255.255.0}
        ifconfig "$interface" "$ip" netmask "$netmask" up
        if [ -n "$router" ]; then
            route add default gw "$router" 2>/dev/null || true
        fi
        if [ -n "$dns" ]; then
            : > /etc/resolv.conf
            for server in $dns; do
                printf 'nameserver %s\n' "$server" >> /etc/resolv.conf
            done
        fi
        ;;
esac