script-deploy-scripts 588 B

1234567891011121314151617
  1. #!/usr/bin/env bash
  2. # Adds the scripts directory to the global PATH
  3. # Copyright 2021-2025 Bryan C. Roessler
  4. # Licensed under the Apache License, Version 2.0
  5. p="${BASH_SOURCE[0]%/*}"; [[ -r $p/script-functions ]] && . "$p"/script-functions || exit 1
  6. script-deploy-scripts() {
  7. local profile_file="/etc/profile.d/99-hartmanlab_server_scripts.sh"
  8. echo "Adding $p to global PATH in $profile_file"
  9. sudo bash -c "echo 'export PATH=\"\$PATH:$p\"' > '$profile_file'"
  10. }
  11. # Allow script to be safely sourced
  12. if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
  13. script-deploy-scripts
  14. exit
  15. fi