]> arthur.barton.de Git - ConfigScripts.git/blobdiff - sys/profile
Make sure UID is always set
[ConfigScripts.git] / sys / profile
index ef07918d2ae1041c2ee687b30004e4de288991e0..08307cb9643ac36ddcdbd2528f805764f670daaf 100644 (file)
@@ -9,9 +9,14 @@
 PROFILEREAD="true"
 export PROFILEREAD
 
+# Make sure UID is set
+[ -n "$UID" ] || UID=`id -u`
+export UID
+
 # Set locale if it is not set or doesn't contain a dot;
 # but all system messages should still be in "native" ("C") language.
-[ "$LANG" = "${LANG#*.}" ] && export LANG="${LANG:-de_DE}.ISO8859-1"
+[ "$LANG" = "${LANG#*.}" -a "$LANG" != "C" ] \
+       && export LANG="${LANG:-de_DE}.ISO8859-1"
 export LC_MESSAGES="C"
 
 # Initialize PATH variable
@@ -72,10 +77,25 @@ export UID USER
 ME=`hostname -s`
 export ME
 
+# Move Xauthority file to local storage, so that sudo et all work
+if [ -z "$XAUTHORITY" -a -r ~/.Xauthority ]; then
+       cp ~/.Xauthority /tmp/Xauthority-$USER
+       chmod 600 /tmp/Xauthority-$USER
+       export XAUTHORITY="/tmp/Xauthority-$USER"
+fi
+
 # read profile additions
 if [ -d /etc/profile.d ]; then
        for f in /etc/profile.d/*; do
-               [ -r "$f" ] && . "$f"
+               [ -r "$f" ] || continue
+               case "$f" in
+                       *.csh)
+                               ;;
+                       *)
+                               [ -e ~/.ConfigScripts.debug ] \
+                                       && echo " >> $f ..."
+                               . "$f"
+               esac
        done
 fi