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