Created
April 25, 2020 09:37
-
-
Save geekman/8c35a552168a7ec0539b0b2be7ba1c5d to your computer and use it in GitHub Desktop.
generate systemd network link files to avoid "s0" prefixes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# generate systemd .link files for "enpX" devices | |
# i don't like the "s0" suffix because it's useless | |
# | |
# 2020.04.25 darell tan | |
# | |
umask 022 | |
for ID in 1 2 3 4; do | |
NAME=/etc/systemd/network/10-net-p${ID}.link | |
echo $NAME | |
cat <<EOF > $NAME | |
[Match] | |
Path=pci-0000:0${ID}:* | |
[Link] | |
Name=enp${ID} | |
EOF | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment