rc.main 397 B

1234567891011121314151617181920212223242526272829303132
  1. #! /bin/sh -
  2. #
  3. # klog/rc.main
  4. #
  5. # Simple kernel log "daemon"
  6. #
  7. # Redirects the standard error to the standard output
  8. exec 2>&1
  9. TARGET="$1"
  10. SVNAME="${2:-klog}"
  11. start()
  12. {
  13. echo "*** ${SVNAME}: Starting klog ..."
  14. while IFS= read -r line
  15. do
  16. echo "$line"
  17. done < /proc/kmsg
  18. }
  19. reset()
  20. {
  21. echo "*** ${SVNAME}: Resetting"
  22. exit 0
  23. }
  24. # Branch to target
  25. eval ${TARGET} "$@"