rcboot.sh 890 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. export PATH=/usr/bin:/usr/sbin:/bin:/sbin
  3. umask 0077
  4. set -e
  5. if [ "$1" != "stop" ]; then
  6. # cleanup
  7. # (delete /tmp etc)
  8. rm -rf /tmp/* /tmp/.[!.]* /tmp/..?*
  9. # empty utmp, create needed directories
  10. : > /var/run/utmp
  11. mkdir -m og-w /var/run/dbus
  12. # Configure random number generator
  13. if [ -e /var/state/random-seed ]; then
  14. cat /var/state/random-seed > /dev/urandom;
  15. fi
  16. # Configure network
  17. /sbin/ifconfig lo 127.0.0.1
  18. # You can put other static configuration here:
  19. #/sbin/ifconfig eth0 192.168.1.38 netmask 255.255.255.0 broadcast 192.168.1.255
  20. echo "myhost" > /proc/sys/kernel/hostname
  21. # /usr/sbin/alsactl restore
  22. else
  23. # The system is being shut down
  24. # echo "Saving random number seed..."
  25. POOLSIZE="$(cat /proc/sys/kernel/random/poolsize)"
  26. dd if=/dev/urandom of=/var/state/random-seed bs="$POOLSIZE" count=1 2> /dev/null
  27. fi;