Просмотр Исходного

{noformat}
#!/bin/bash

if [ "$1" = "rc.mount" ]; then
#oldaddr старый mac адрес
#newaddr новый mac адрес
oldaddr='00:04:23:b0:8f:01'
newaddr='00:04:23:b0:8f:02'
iface=
while read num iface text; do
[[ "$text" = *"$oldaddr"* ]] && break;
done < <( /sbin/ip -o link )
iface="${iface%:}"
if [ -n "$iface" ]; then
/sbin/ip link set "$iface" down
/sbin/ip link set "$iface" address "$newaddr"
else
echo "Interface not found during address change"
fi
fi

true
{noformat}Выполнить мягкую перезагрузку