diff --git a/usr/bin/dracut-ukify b/usr/bin/dracut-ukify index c43c736..290b256 100755 --- a/usr/bin/dracut-ukify +++ b/usr/bin/dracut-ukify @@ -76,11 +76,11 @@ EOF if [ -f "${i}" ] then echo "${i} exist" - keys_count=$(expr $keys_count + 1) + keys_count=$(($keys_count + 1)) fi done - if [[ $keys_count -lt 6 ]] + if [ $keys_count -lt 6 ] then for i in "${keys[@]}" do @@ -88,13 +88,13 @@ EOF then echo "${i} remove" rm "${i}" - keys_count=$(expr $keys_count - 1) + keys_count=$(($keys_count - 1)) fi done fi echo "Keys = $keys_count" - if [ -f "${ukify_conf}" ] && [[ $keys_count == 0 ]] + if [ -f "${ukify_conf}" ] && [ $keys_count == 0 ] then echo "Generate keys" /usr/lib/systemd/ukify genkey --config "${ukify_conf}" @@ -181,7 +181,7 @@ if (( update_all )); then for kernel_path in /usr/lib/modules/*; do [ -f "$kernel_path/pkgbase" ] || continue - kernel_version=$(basename $kernel_path) + kernel_version=$(basename "$kernel_path") kernel_dir="/usr/lib/modules/$kernel_version" pkgbase="$kernel_dir/pkgbase" kernel_name=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "$pkgbase") @@ -207,13 +207,13 @@ function gen_image() { cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' "/etc/kernel/cmdline") elif [ -f "/boot/refind_linux.conf" ]; then - cmdline=$(cat "/boot/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') + cmdline=$(head -n 1 < "/boot/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') elif [ -f "/efi/refind_linux.conf" ]; then - cmdline=$(cat "/efi/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') + cmdline=$(head -n 1 < "/efi/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') elif [ -f "/boot/efi/refind_linux.conf" ]; then - cmdline=$(cat "/boot/efi/refind_linux.conf" | head -n 1 | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') + cmdline=$(head -n 1 < "/boot/efi/refind_linux.conf" | sed -e 's|"Boot with standard options"||g' | awk '{$1=$1;print}' | sed -e 's/"//g') else cmdline=$(sed -e 's/^[[:space:]]//g' -e 's/[[:space:]]$//g' -e 's/initrd.*$//g' "/proc/cmdline")