From eb32c9ae03b468f5c0303a1011fab9049990d0bb Mon Sep 17 00:00:00 2001 From: "kebler.net" Date: Thu, 30 Dec 2021 13:15:01 -0800 Subject: [PATCH] fix: get correct script directory --- all/modules/lightdm/loginout-install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/all/modules/lightdm/loginout-install.sh b/all/modules/lightdm/loginout-install.sh index 94efcce..694c28f 100755 --- a/all/modules/lightdm/loginout-install.sh +++ b/all/modules/lightdm/loginout-install.sh @@ -5,7 +5,9 @@ loginout_install() { [[ ! $(systemctl list-units | grep lightdm) ]] && echo lightdm not running on this machine, aborting && return - SDIR=$(adirname "$0") + SDIR=$(adirname "${BASH_SOURCE[0]}") + # echo source directory: $SDIR + pushd $SDIR &> /dev/null || exit [[ ! -d /etc/lightdm/lightdm.conf.d ]] && mkdir -p /etc/lightdm/lightdm.conf.d @@ -35,8 +37,8 @@ function add_user_session { module_load confirm module_load helpers - - SDIR=$(adirname "$0") + + SDIR=$(adirname "${BASH_SOURCE[0]}") # echo source directory: $SDIR pushd $SDIR &> /dev/null || exit