Advertisement
abrodkin

post-boot

Aug 9th, 2011
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.74 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # DESCRIPTION
  4. # master "post-boot" script for Asus wl500g router.
  5. #
  6. # Starts Sxx_... scripts on "post-boot" event
  7. # in numerical order
  8. #
  9. #
  10. # INSTRUCTIONS
  11. # Put script in "/usr/local/sbin"
  12. # Save flashfs:
  13. #     flashfs save && flashfs commit && flashfs enable
  14. # Reboot device
  15. #     reboot
  16.  
  17. # Log to stderr as well as the system log
  18. LOGGER_OPTIONS=-s
  19.  
  20. # Delay in seconds before next script start
  21. DELAY=2
  22.  
  23. logger $LOGGER_OPTIONS "Starting post-boot scripts..."
  24.  
  25. for i in /usr/local/sbin/S??*
  26. do
  27.     # ignore dangling symlinks (if any)
  28.     [ ! -f "$i" ] && continue
  29.     logger $LOGGER_OPTIONS "Starting <$i> script..."
  30.     $i &
  31.     sleep $DELAY
  32. done
  33.  
  34. logger $LOGGER_OPTIONS "All post-boot scripts were started"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement