args=("$@")
files=$(
while (( $# > 0 )); do
- for i in ${1}/*${suffix}; do
- [[ -f $i ]] && echo ${i##*/}
+ for i in "${1}"/*"${suffix}"; do
+ [[ -f $i ]] && echo "${i##*/}"
done
shift
done | sort -Vu
if [[ ${KERNEL_INSTALL_MACHINE_ID+x} ]]; then
MACHINE_ID=$KERNEL_INSTALL_MACHINE_ID
elif [[ -f /etc/machine-id ]] ; then
- read MACHINE_ID < /etc/machine-id
+ read -r MACHINE_ID < /etc/machine-id
fi
if ! [[ $MACHINE_ID ]]; then
# source our config dir
for f in $(dropindirs_sort ".conf" "/etc/dracut.conf.d" "/usr/lib/dracut/dracut.conf.d"); do
- [[ -e $f ]] && . "$f"
+ if [[ -e $f ]]; then
+ # shellcheck disable=SC1090
+ . "$f"
+ fi
done
+ # shellcheck disable=SC2154
[[ $dracut_rescue_image != "yes" ]] && exit 0
[[ -d "$BOOT_DIR_ABS" ]] || mkdir -p "$BOOT_DIR_ABS"
echo "title $PRETTY_NAME - Rescue Image"
echo "version $KERNEL_VERSION"
echo "machine-id $MACHINE_ID"
- echo "options ${BOOT_OPTIONS[@]} rd.auto=1"
+ echo "options ${BOOT_OPTIONS[*]} rd.auto=1"
echo "linux $BOOT_DIR/linux"
echo "initrd $BOOT_DIR/initrd"
- } > $LOADER_ENTRY
+ } > "$LOADER_ENTRY"
else
if [[ -e "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" ]]; then
- cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" $LOADER_ENTRY
+ cp -aT "${BLS_DIR}/${MACHINE_ID}-${KERNEL_VERSION}.conf" "$LOADER_ENTRY"
else
- cp -aT "${KERNEL_IMAGE%/*}/bls.conf" $LOADER_ENTRY
+ cp -aT "${KERNEL_IMAGE%/*}/bls.conf" "$LOADER_ENTRY"
fi
- sed -i 's/'$KERNEL_VERSION'/0-rescue-'${MACHINE_ID}'/' $LOADER_ENTRY
+ sed -i "s/${KERNEL_VERSION}/0-rescue-${MACHINE_ID}/" "$LOADER_ENTRY"
fi
((ret+=$?))