From Little Hedgehog, 5 Years ago, written in Plain Text.
Embed
  1. !/bin/sh
  2. #
  3. # VBOX-KERN    This shell script takes care of reinstalling VirtualBox kernel modules
  4. #              when a kernel has been upgraded
  5. #
  6. # chkconfig: - 30 60
  7. # description:
  8. #               Automatically Reinstall VBox on booting a new kernel
  9. #
  10. # probe: true
  11.  
  12. kern=$(uname -r)
  13.  
  14. if [ ! -f /root/kern ]
  15. then
  16.         echo $kern > /root/kern
  17. else
  18.         ckern=$(cat /root/kern)
  19. fi
  20.  
  21. if [ ! $kern == $ckern ]
  22. then
  23.         echo $kern > /root/kern
  24.         if [ -f /root/vmware-tools-dilsstrib/vmware-install.pl ]
  25.         then
  26.                 /etc/init.d/vboxdrv setup
  27.                 #/root/vmware-tools-dilsstrib/vmware-install.pl --default
  28.         fi
  29. fi
  30.