Advertisement
Guest User

Holger

a guest
Jan 25th, 2008
702
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # A generic /sbin/hotplug multiplexer program
  4. #
  5. # This script allows any program to be called when /sbin/hotplug is
  6. # called. It will run any programs located in the default hotplug
  7. # directory (currently /etc/hotplug.d/) that match up with the first
  8. # argument that this script is called with. The matching is done by
  9. # adding a directory name to the default directory and looking for any
  10. # programs in that directory that are executable, and end in .hotplug
  11. # (to allow backup programs to be live on safely.)
  12. #
  13. # For example, if /sbin/hotplug is called with the usb argument then
  14. # this script will look in the /etc/hotplug.d/usb/ directory for any
  15. # executable programs that end in .hotplug.
  16. #
  17. # After all programs in the argument directory are executed, the
  18. # "default" directory is searched for any executable programs in it,
  19. # that end in .hotplug. The default directory is currently
  20. # /etc/hotplug.d/default/
  21. #
  22. # - Greg Kroah-Hartman
  23. # May 1, 2003
  24. #
  25. # Released under the GPL Version 2.
  26. #
  27.  
  28. DIR="/etc/hotplug.d"
  29.  
  30. for I in "${DIR}/$1/"*.hotplug "${DIR}/"default/*.hotplug ; do
  31. if [ -f $I ]; then
  32. test -x $I && $I $1 ;
  33. fi
  34. done
  35.  
  36. exit 1
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement