# /etc/profile

# Function to easily append a directory to PATH
append_path() {
  if [ -z "$1" ]; then
    return 1
  elif ! [ -d "$1" ]; then
    return 1
  fi
  export PATH="$PATH":"$1"
}

# Appending paths
append_path '/usr/sbin'
append_path '/usr/local/bin'
append_path '/usr/local/sbin'

# Source locale.conf
if [ -f /etc/locale.conf ]; then
  set -a
  . /etc/locale.conf
  set +a
fi

if [ -d /etc/profile.d ]; then
	for f in /etc/profile.d/*.sh; do
		[ -r "$f" ] && source "$f"
	done
fi

# Unsetting functions
unset -f append_path

# Run /etc/bashrc if in an interactive terminal
if [[ $- == *i* ]]; then
    . /etc/bashrc
fi

