base-files: remove a 'not found' error message during system boot
[openwrt/staging/chunkeey.git] / package / base-files / files / etc / uci-defaults / 12_network-generate-ula
1 #!/bin/sh
2
3 [ "$(uci -q get network.globals.ula_prefix)" != "auto" ] && exit 0
4
5 r1=$(dd if=/dev/urandom bs=1 count=1 |hexdump -e '1/1 "%02x"')
6 r2=$(dd if=/dev/urandom bs=2 count=1 |hexdump -e '2/1 "%02x"')
7 r3=$(dd if=/dev/urandom bs=2 count=1 |hexdump -e '2/1 "%02x"')
8
9 uci -q batch <<-EOF >/dev/null
10 set network.globals.ula_prefix=fd$r1:$r2:$r3::/48
11 commit network
12 EOF
13
14 exit 0
15