You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reset_prololive.sh 442B

12345678910111213141516171819202122232425262728293031
  1. #! /usr/bin/env sh
  2. if [ $# -ne 1 ]
  3. then
  4. echo "Usage: $0 sdx" >&2
  5. exit 64
  6. fi
  7. disk="/dev/$1"
  8. partition=2
  9. if [ ! -b "${disk}" ]
  10. then
  11. echo "${disk} does not exists or is not a valid device" >&2
  12. exit 1
  13. fi
  14. dir=$(mktemp -d)
  15. echo "Mounting partition..."
  16. mount "${disk}${partition}" "${dir}" || {
  17. echo "Failed to mount partition" >&2
  18. exit 2
  19. }
  20. echo "Removing files..."
  21. rm ${dir}/* -rf
  22. echo "Unmounting partition..."
  23. umount "${dir}"