skeleton 755 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # Licence : GPL v3
  3. # Author: Laurent HUBERT
  4. #
  5. # Example file for first-boot-script
  6. # Copy this file to a new file and add permission execution to the new file
  7. # Example:
  8. # # cp skeleton 02-myscript
  9. # # chmod +x 02-myscript
  10. #
  11. # Example Section : Displaying a banner
  12. cat <<EOF
  13. +---------------------------------------------+
  14. | My Banner |
  15. +---------------------------------------------+
  16. EOF
  17. # Example Section : asking user to enter a value
  18. read -p "Please enter a value: " answer
  19. # Example Section: use the value only if not empty
  20. if [ -n "$answer" ]
  21. then
  22. echo Using $answer as user data
  23. # Do something here
  24. exit 0
  25. else
  26. # Exit with non zero status
  27. echo "### Explicit error message ###"
  28. exit 1
  29. fi