anaconda/anaconda-40.22.3.13/dracut/anaconda-ifdown
2024-11-14 21:39:56 -08:00

16 lines
401 B
Bash
Executable file

#!/bin/bash
#
# Turn off given network interface and remove all its flags from Dracut.
#
# Author: Jiri Konecny
#
netif="$1"
# ip down/flush ensures that routing info goes away as well
ip link set "$netif" down
ip addr flush dev "$netif"
rm -f -- /tmp/*."$netif".*
if [ -e "/sys/class/net/$netif/address" ]; then
address=$(cat "/sys/class/net/$netif/address")
rm -f -- /tmp/*."$address".*
fi