home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / ifupdown / examples / pcmcia-compat.sh < prev    next >
Encoding:
Linux/UNIX/POSIX Shell Script  |  2008-06-21  |  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.