longsube

Untitled

Jan 16th, 2017
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #!/bin/bash
  2. # THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
  3. #
  4. # It is highly advisable to create own systemd services or udev rules
  5. # to run scripts during boot instead of using this file.
  6. #
  7. # In constrast to previous versions due to parallel execution during boot
  8. # this script will NOT be run after all other services.
  9. #
  10. # Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
  11. # that this script will be executed during boot.
  12. for iface in $(ip -o link | cut -d: -f2 | tr -d ' ' | grep ^eth)
  13. do
  14. test -f /etc/sysconfig/network-scripts/ifcfg-$iface
  15. if [ $? -ne 0 ]
  16. then
  17. nmcli con add type ethernet con-name $iface ifname $iface
  18. nmcli con up $iface
  19. ifdown $iface && ifup $iface
  20. fi
  21. done
Advertisement
Add Comment
Please, Sign In to add comment