# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

PATH="/usr/local/bin:/usr/bin:/bin"
EDITOR="/bin/vi"	# needed for packages like cron
TERM="vt100"		# Basic terminal capab. For screen etc.
DBUS_SESSION_BUS_ADDRESS="unix:path=/tmp/session_bus_socket"
DBUS_SYSTEM_BUS_ADDRESS="unix:path=/var/run/dbus/system_bus_socket"

#if [ ! -e /etc/localtime ]; then
#	TZ="UTC"		# Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html 
#				# for an explanation of how to set this to your local timezone.
#	export TZ
#fi

# Pick timezone setting from luna folder
if [ ! -e /var/luna/preferences/localtime ]; then
   # set default timezone to Pacific std time
   mkdir -p /var/luna/preferences
   ln -s /usr/share/zoneinfo/America/Los_Angeles /var/luna/preferences/localtime
fi

TZ=":/var/luna/preferences/localtime"
export TZ

if [ "`id -u`" -eq 0 ]; then
   PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin:
fi
if [ "$PS1" ]; then
# works for bash and ash (no other shells known to be in use here)
   PS1='\u@\h:\w\$ '
fi

if [ -d /etc/profile.d ]; then
  for i in `ls /etc/profile.d/`; do
    . /etc/profile.d/$i
  done
  unset i
fi

export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM DBUS_SESSION_BUS_ADDRESS DBUS_SYSTEM_BUS_ADDRESS

export HISTFILE=/tmp/.ash_history$$

umask 022

# define DBUS_SESSION_BUS_ADDRESS, even if it's already defined.  That
# way if the bus is restarted new logins will have the right information

# if [ -f /var/run/dbus/env ]; then 
#     export DBUS_SESSION_BUS_ADDRESS=$(sed 's/.*\(unix:.*\),.*/\1/' < /var/run/dbus/env)
# fi

alias ldd='LD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes '
