This commit is contained in:
Your Name 2024-07-25 18:00:33 -04:00
parent ca8249e079
commit 3cda18fef6
1 changed files with 3 additions and 12 deletions

View File

@ -1,18 +1,9 @@
# /etc/profile.d/sum.sh # /etc/profile.d/sum.sh
# Ensure the script is sourced, not executed # Ensure the script is sourced, not executed
if [ -n "$ZSH_VERSION" ]; then if [[ "$0" == "${BASH_SOURCE[0]}" ]] || [[ "$0" == "${(%):-%x}" ]]; then
# For zsh echo "This script should be sourced, not executed."
if [[ "${(%):-%x}" == "$0" ]]; then return 1 2>/dev/null || exit 1
echo "This script should be sourced, not executed."
return 1
fi
else
# For bash
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "This script should be sourced, not executed."
return 1
fi
fi fi
# Function to generate SHA-256 hashes for .sh files in a given directory # Function to generate SHA-256 hashes for .sh files in a given directory