alexkuklin: (Default)
[personal profile] alexkuklin
навык "курощение systemd" - +5

[root@localhost ~]# cat /etc/systemd/system/macfix\@.service
[Unit]
Description=MAC Address fix %I
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/macfix %i
[Install]
WantedBy=multi-user.target
[root@localhost ~]# cat /usr/local/sbin/macfix
#!/bin/bash
. /etc/sysconfig/network-scripts/ifcfg-eth0
[ -z "$HWADDR" ] && echo HWADDR=`cat /sys/class/net/eth0/address` >> /etc/sysconfig/network-scripts/ifcfg-eth0
# systemctl enable macfix@eth0.service

привязку к eth0, наверное, можно открутить, но уже лень

Profile

alexkuklin: (Default)
alexkuklin

January 2016

S M T W T F S
     12
34567 89
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 28th, 2017 12:55 pm
Powered by Dreamwidth Studios