fix: further improve portability of login-profile.sh

The `-d ""` check is false on bash and zsh, but there might be some rare shell out there which treats it as "." or similar, so let's guard against that risk by also verifying that `$HOME` is a non-empty string before we check if it's a directory.
This commit is contained in:
Arcitec
2023-05-13 05:03:55 +02:00
committed by Eino Rauhala
parent cec73978cf
commit 4318180a7c

View File

@@ -1,5 +1,5 @@
# Only process users with home directories, but skip the "root" user.
if [ "$(id -u)" != "0" ] && [ -d "$HOME" ]; then
if [ "$(id -u)" != "0" ] && [ ! -z "$HOME" ] && [ -d "$HOME" ]; then
# Ensure target file exists and is a symlink (not a regular file or dir).
if [ ! -L "$HOME"/.config/autostart/ublue-firstboot.desktop ]; then
# Remove any leftovers or incorrect (non-link) files with the same name.