1
0
mirror of https://github.com/systemd/systemd.git synced 2025-10-21 15:33:40 +03:00

fix(SC2164): robust cd conditional

This commit is contained in:
Eisuke Kawashima
2025-07-14 17:10:59 +09:00
parent 01e769bc2e
commit b371e7252c

View File

@@ -36,11 +36,11 @@ _kernel_install() {
comps="add remove"
;;
2)
comps=$(cd /lib/modules; echo [0-9]*)
comps=$(cd /lib/modules && echo [0-9]*)
if [[ ${COMP_WORDS[1]} == "remove" ]] && [[ -f /etc/machine-id ]]; then
read -r MACHINE_ID < /etc/machine-id
if [[ $MACHINE_ID ]] && ( [[ -d /boot/$MACHINE_ID ]] || [[ -L /boot/$MACHINE_ID ]] ); then
comps=$(cd "/boot/$MACHINE_ID"; echo [0-9]*)
comps=$(cd "/boot/$MACHINE_ID" && echo [0-9]*)
fi
fi
;;