blob: 5c603d801fd5bcab7af1914356500ffaeb4fecaa (
plain) (
blame)
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
26
|
#!/bin/sh
#
# Script fragment to make ifupdown supply DNS information to resolved
#
case "$ADDRFAM" in
inet|inet6) : ;;
*) exit 0 ;;
esac
if systemctl is-enabled systemd-resolved > /dev/null 2>&1; then
interface=$IFACE
if [ ! "$interface" ]; then
return
fi
ifindex=$(cat "/sys/class/net/$interface/ifindex")
if [ ! "$ifindex" ]; then
return
fi
mystatedir=/run/network
statedir=/run/systemd/resolve/netif
rm -f "$mystatedir/isc-dhcp-v4-$interface" "$mystatedir/isc-dhcp-v6-$interface" "$mystatedir/ifupdown-inet-$interface" "$mystatedir/ifupdown-inet6-$interface" "$statedir/$ifindex"
if systemctl --quiet is-active systemd-resolved; then
resolvectl revert "$ifindex" || true
fi
fi
|