]> arthur.barton.de Git - ConfigScripts.git/commitdiff
Only try to create local home directory if /usr/local/home already exists
authorAlexander Barton <alex@barton.de>
Sat, 26 Apr 2014 15:21:23 +0000 (17:21 +0200)
committerAlexander Barton <alex@barton.de>
Sat, 26 Apr 2014 15:21:23 +0000 (17:21 +0200)
sys/profile

index 368d07e62d98093aa631780960500dc90cc124e9..a190bd78f570c76e8d84de594808f3533487f2aa 100644 (file)
@@ -105,12 +105,14 @@ fi
 [ -n "$HOSTNAME" ] || HOSTNAME=`hostname 2>/dev/null`
 export HOSTNAME
 
-# Setup some directories to use local storage (no NFS)
-[ -d "/usr/local/home/$LOGNAME" ] \
-       || ( mkdir /usr/local/home; mkdir "/usr/local/home/$LOGNAME" ) >/dev/null 2>&1
+# Setup local home directory, when available
+[ -d "/usr/local/home" -a ! -d "/usr/local/home/$LOGNAME" ] \
+       && mkdir "/usr/local/home/$LOGNAME" >/dev/null 2>&1
 [ -w "/usr/local/home/$LOGNAME" ] \
        && export LOCAL_HOME="/usr/local/home/$LOGNAME" \
        || export LOCAL_HOME="$HOME"
+
+# Setup environment to use local storage (no NFS, if possible!)
 export XDG_CACHE_HOME="$LOCAL_HOME/.cache"
 
 # Setup environment for ccache, if installed