HEX
Server: Apache
System: Linux msm5694.mjhst.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: camjab_ssh (1000)
PHP: 5.3.29
Disabled: NONE
Upload Files
File: //usr/local/sbin/fixnix
#!/bin/bash

#Permanent placement @/usr/local/sbin/fixnix, and called from /etc/rc.local

mace0=$(biosdevname -d|sed -e '/./{H;$!d;}' -e 'x;/eth0/!d;'|awk '/Permanent MAC/ {print $3}')
mace1=$(biosdevname -d|sed -e '/./{H;$!d;}' -e 'x;/eth1/!d;'|awk '/Permanent MAC/ {print $3}')
h0=$(echo $((0x$(echo $mace0|tr -d ':'))))
h1=$(echo $((0x$(echo $mace1|tr -d ':'))))
goodorbad=$(expr $h0 - $h1)

if [ $goodorbad -gt 0 ]
then

ip link set eth1 down
ip link set eth0 down
ip link set eth1 name eth11 down
ip link set eth0 name eth1 up
ip link set eth11 name eth0 up
ip link set eth0 up
ip link set eth1 up

fi

ifup eth0
ifup eth1