#!/bin/sh

umask 0002;
host=$(hostname);

export BASH_DIR="$HOME/.bash";
export BASH_ENV="$HOME/.bashrc";
export DBUS_ENV="/var/run/dbus.env/$USER.dbus.env";
export PATH="${HOME}/bin:/opt/bin:/usr/local/bin:/usr/bin:/bin:/opt/er2/bin:/opt/epics/bin/linux-x86";

[[ -r "$DBUS_ENV" ]] && . "$DBUS_ENV";
if [[ -z "$DBUS_SESSION_BUS_PID" || \
	-z $(pgrep -u "$USER" dbus-daemon | grep "^$DBUS_SESSION_BUS_PID\$") ]]; then
	dbus_env=$(dbus-launch --sh-syntax);
	eval "$dbus_env";
	echo "$dbus_env" >"$DBUS_ENV";
	chmod go= "$DBUS_ENV";
fi

[[ -f /etc/DIR_COLORS ]] && eval $(dircolors -b /etc/DIR_COLORS);
[[ -f "$HOME/.xinitrc" && ! -e "$HOME/.xsession" ]] && ln -s .xinitrc "$HOME/.xsession";
[[ -n "$ISSCREEN" ]] && screen -wipe;

[[ -f "$BASH_DIR/bash_profile" ]]       && . "$BASH_DIR/bash_profile";
[[ -f "$BASH_DIR/bash_profile.local" ]] && . "$BASH_DIR/bash_profile.local";
[[ -f "$BASH_DIR/bash_profile.$host" ]] && . "$BASH_DIR/bash_profile.$host";
[[ -f "$BASH_DIR/bash_profile.$USER" ]] && . "$BASH_DIR/bash_profile.$USER";

[[ -f "$BASH_ENV" ]] && . "$BASH_ENV";


# vim:ft=sh tw=0 nowrap:
