settings 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. # shellcheck shell=bash
  3. ################################################################################
  4. ################## The configuration parameters of the script ##################
  5. ################################################################################
  6. # Bash 'Strict Mode':
  7. # errexit - exit the script if any statement returns a non-true return value
  8. # pipefail - exit the script if any command in a pipeline errors
  9. # nounset - exit the script if you try to use an uninitialised variable
  10. # xtrace - display debugging information
  11. set -o pipefail
  12. # Internal field separator (more flexible):
  13. # IFS_ORIG="$IFS"
  14. # IFS_HACK=$'\n\t'
  15. # IFS="$IFS_HACK"
  16. # PATH env variable setup:
  17. PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  18. # Setting permissions in the script environment:
  19. # 0022 - less restrictive settings (default value)
  20. # 0027 - for better security than above
  21. # 0077 - only for user access (more restrictive)
  22. umask 0027
  23. # Catch the listed SIGNALS, which may be signal names with or without the SIG
  24. # prefix, or signal numbers. By default, only the signal 0 or EXIT is supported.
  25. trap "_get_trap_SIG EXIT" EXIT
  26. # shellcheck disable=SC2173
  27. # trap "_get_trap_SIG SIGS" SIGHUP SIGTERM SIGKILL SIGINT