home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / boot / i386 / rescue / etc / sysconfig / network / scripts / drop-hotplug-symlink.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  2006-11-29  |  405b  |  21 lines

  1. #!/bin/bash
  2.  
  3. # Drop the compatibility symbolic link in /etc/sysconfig/network,
  4. # usually as ifcfg-eth-pcmcia -> ifcfg-eth-pcmcia-0,
  5.  
  6. path=${root}/etc/sysconfig/network
  7. types="eth-pcmcia eth-usb tr-pcmcia tr-usb"
  8.  
  9. # path=/tmp/n
  10. cd "$path"
  11.  
  12. for t in $types; do
  13.   f="ifcfg-$t"
  14.   test -L "$f" || continue
  15.   s="$(readlink "$f")"
  16.   test -f "$s" || continue
  17.   echo "$f -> $s"
  18.   rm -f "$f"
  19.   mv -f "$s" "$f"
  20. done
  21.