rc.local 851 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. if [ "$(cat /sys/class/net/eth1/address)" = "52:54:00:31:14:02" ]; then
  3. ifconfig eth1 192.168.0.2/24
  4. fi
  5. if [ "$(cat /sys/class/net/eth1/address)" = "52:54:01:31:14:02" ]; then
  6. ifconfig eth1 192.168.0.3/24
  7. fi
  8. ETH2MAC="$(cat /sys/class/net/eth2/address)"
  9. if [ "$ETH2MAC" = "52:54:00:31:14:03" -o "$ETH2MAC" = "52:54:01:31:14:03" ]; then
  10. rm -f /etc/resolv.conf.eth0
  11. cp /etc/resolv.conf /etc/resolv.conf.eth0
  12. dhclient eth2
  13. killall dhclient
  14. cp /etc/resolv.conf.eth0 /etc/resolv.conf
  15. sleep 60 && cp /etc/resolv.conf.eth0 /etc/resolv.conf &
  16. fi
  17. #(
  18. # dd if=/dev/zero of=/var/cache/fscache/image bs=1M count=512
  19. # losetup /dev/loop1 /var/cache/fscache/image
  20. # mkfs.ext4 /dev/loop1
  21. # mount /dev/loop1 /var/cache/fscache
  22. # sed -e 's/^#RUN/RUN/' -i /etc/default/cachefilesd
  23. # /etc/init.d/cachefilesd start
  24. #)&
  25. #fmtutil-sys --all &
  26. exit 0