home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / ifupdown / examples / pcmcia-compat.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2005-05-12  |  491 b   |  30 lines

  1. #!/bin/sh
  2.  
  3. if [ ! -e /etc/pcmcia/shared ]; then exit 1; fi
  4.  
  5. pcmcia_shared () {
  6.     . /etc/pcmcia/shared
  7. }
  8.  
  9. iface="$1"
  10.  
  11. # /etc/pcmcia/shared sucks
  12. pcmcia_shared "start" $iface
  13. usage () {
  14.     exit 1
  15. }
  16.  
  17. get_info $iface
  18. HWADDR=`/sbin/ifconfig $DEVICE | sed -n -e 's/.*addr \([^ ]*\) */\1/p'`
  19.  
  20. which=""
  21. while read glob scheme; do
  22.     if [ "$which" ]; then continue; fi
  23.     case "$SCHEME,$SOCKET,$INSTANCE,$HWADDR" in
  24.         $glob) which=$scheme ;;
  25.     esac
  26. done
  27.  
  28. if [ "$which" ]; then echo $which; exit 0; fi
  29. exit 1
  30.