From 3295c5fd9b09fe0af48e11222c41d69f5bae5dbe Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 13 Apr 2015 15:10:22 -0400 Subject: login.sh: Do a better job of handling if variables aren't set --- .config/login.d/90_symlink_xdg_runtime_dir.sh | 6 ++++-- .config/login.sh | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/login.d/90_symlink_xdg_runtime_dir.sh b/.config/login.d/90_symlink_xdg_runtime_dir.sh index b89f7b1..bc6109d 100644 --- a/.config/login.d/90_symlink_xdg_runtime_dir.sh +++ b/.config/login.d/90_symlink_xdg_runtime_dir.sh @@ -1,4 +1,6 @@ # This is really only needed for ssh ControlPath; as I don't have a # way to communicate XDG_RUNTIME_DIR -mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" -ln -sfT -- "$XDG_RUNTIME_DIR" "$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME" +if [ -n "$XDG_RUNTIME_DIR" ]; then + mkdir -p -- "$XDG_CACHE_HOME/xdg-runtime-dir" + ln -sfT -- "$XDG_RUNTIME_DIR" "$XDG_CACHE_HOME/xdg-runtime-dir/$HOSTNAME" +fi diff --git a/.config/login.sh b/.config/login.sh index b2cc80a..538920a 100644 --- a/.config/login.sh +++ b/.config/login.sh @@ -11,6 +11,10 @@ # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. +if [ -z "$HOME" ]; then + eval 'HOME=~' + export HOME +fi for file in "${XDG_CONFIG_HOME:-$HOME/.config}/login.d/"*.sh; do . "$file" done -- cgit v1.1-4-g5e80