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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user