local-user 632 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/sbin/runscript
  2. # Copyright (c) 2007-2008 Roy Marples <roy@marples.name>
  3. # Released under the 2-clause BSD license.
  4. description="Executes user programs in ~/local.d"
  5. depend()
  6. {
  7. after *
  8. keyword -timeout
  9. }
  10. start()
  11. {
  12. einfo "Starting local"
  13. local user
  14. local file
  15. for user in /home/* ; do
  16. for file in ${user}/local.d/*.start ; do
  17. [ -x "$file" ] && su ${user/#"/home/"/} -c "\"$file\""
  18. done
  19. done
  20. eend 0
  21. }
  22. stop()
  23. {
  24. einfo "Stopping local"
  25. local user
  26. local file
  27. for user in /home/* ; do
  28. for file in ${user}/local.d/*.stop ; do
  29. [ -x "$file" ] && su ${user/#"/home/"/} -c "\"$file\""
  30. done
  31. done
  32. eend 0
  33. }