Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

dkms-8192cu.install

By: a guest on Jul 27th, 2013  |  syntax: Bash  |  size: 0.84 KB  |  views: 87  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. post_install (){
  2.  
  3.     MODULE="8192cu"
  4.     DKMS=$(which dkms)
  5.     MODPROBE=$(which modprobe)
  6.     VERSION="v3.4.4_4749"
  7.  
  8.     $DKMS add -m $MODULE -v $VERSION
  9.     $DKMS build -m $MODULE -v $VERSION
  10.     $DKMS install -m $MODULE -v $VERSION
  11.  
  12.     #$MODPROBE -a $MODULE
  13.    
  14. }
  15.  
  16. pre_upgrade(){
  17.     pre_remove
  18. }
  19.  
  20. post_upgrade(){
  21.     post_install
  22. }
  23.  
  24. pre_remove (){
  25.     #_inmemory=$(/usr/bin/lsmod | /usr/bin/grep 8192cu)
  26.     #if [ ! -z "$_inmemory" ]; then
  27.     #    /usr/bin/rmmod 8192cu &> /dev/null
  28.     #fi
  29.  
  30.     DKMS=$(which dkms)
  31.  
  32.     _line=$($DKMS status -m 8192cu)
  33.     if echo "$_line" | grep -E 'added|built|installed'; then
  34.         version=$(echo "$_line" | sed 's/8192cu,\([^,]*\)[,:].*/\1/;t;d')
  35.         $DKMS remove -m 8192cu -v $version --all
  36.     fi
  37. }
  38.  
  39. post_remove () {
  40.     /sbin/depmod -a
  41. }
  42.  
  43. op=$1
  44. shift
  45. $op $*