vestasync/apply_macs.sh
2023-04-16 13:34:19 +07:00

11 lines
258 B
Bash

#!/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