8 releases (4 stable)
1.1.1 | Aug 5, 2024 |
---|---|
1.1.0 | Mar 14, 2022 |
1.0.1 | Feb 11, 2022 |
0.1.4 | Jan 14, 2022 |
0.1.3 | Dec 25, 2021 |
#330 in Hardware support
26KB
346 lines
ifcfg-devname
Initscripts rename_device
binary rewritten using rust and renamed to ifcfg-devname
.
Program ifcfg-devname
reads ENV INTERFACE, which is expected to contain the name of the network interface. Then it looks for the hardware address of such an interface. After that it scans ifcfg configuration files in directory /etc/sysconfig/network-scripts/
and looks for configuration with HWADDR set to given hw address. If the program successfully finds such a configuration, it returns on standard output content of property DEVICE from matching ifcfg configuration. In all other cases it returns error code 1
.
How to use it
This repository provides source code for ifcfg-devname
binary. The binary requires env INTERFACE to be set.
INTERFACE=eth0 cargo run --release
Environment variable INTERFACE takes name of the interface.
Dependencies
~3–11MB
~119K SLoC