vestasync/apply_macs.sh

11 lines
258 B
Bash
Raw Normal View History

2023-04-16 09:34:19 +03:00
#!/bin/bash
macs_dir="/mnt/data/etc/vestasync/macs"
for mac_file in "$macs_dir"/*; do
ifname=$(basename "$mac_file")
if [ -f "$mac_file" ]; then
mac_address=$(cat "$mac_file")
ip link set "$ifname" address "$mac_address"
fi
done