S02resize_rootfs 512 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. THIS=$(basename $0)
  3. case "$1" in
  4. start)
  5. sleep 1
  6. echo "$THIS: starting resizing the root partition" | tee /dev/kmsg &&
  7. resize_rootfs &&
  8. rm /etc/init.d/S02resize_rootfs
  9. if [ $? -eq 0 ]; then
  10. echo "$THIS: finished resizing the root partition, rebooting to enlarge the root filesystem" | tee /dev/kmsg
  11. reboot
  12. exit 0
  13. else
  14. echo "$THIS: cannot resize the root partition, aborting" | tee /dev/kmsg
  15. exit 1
  16. fi
  17. ;;
  18. *)
  19. echo "Usage: $0 start" >&2
  20. exit 2
  21. ;;
  22. esac