mirror of
https://git.proxmox.com/git/proxmox-kernel-helper
synced 2025-10-04 22:55:17 +00:00
boot tool: fix grep misinterpretation of arguments starting with a hyphen
`proxmox-boot-tool kernel remove --help`, or any version agrument that started with a '-', lead to the grep usage message being written into /etc/kernel/proxmox-boot-manual-kernels. The problem was `grep` interpreted the kernel version agrument as an option since it starts with '-'.
This commit is contained in:
parent
9778a17731
commit
a6a8d3fd27
@ -27,7 +27,7 @@ _remove_entry_from_list_file() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e "$file" ]; then
|
if [ -e "$file" ]; then
|
||||||
grep -vFx "$entry" "$file" > "$file.new" || true
|
grep -vFx -- "$entry" "$file" > "$file.new" || true
|
||||||
mv "$file.new" "$file"
|
mv "$file.new" "$file"
|
||||||
else
|
else
|
||||||
echo "'$file' does not exist.."
|
echo "'$file' does not exist.."
|
||||||
@ -279,7 +279,7 @@ remove_kernel() {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if grep -sqFx "$ver" "$MANUAL_KERNEL_LIST"; then
|
if grep -sqFx -- "$ver" "$MANUAL_KERNEL_LIST"; then
|
||||||
_remove_entry_from_list_file "$MANUAL_KERNEL_LIST" "$ver"
|
_remove_entry_from_list_file "$MANUAL_KERNEL_LIST" "$ver"
|
||||||
echo "Removed kernel '$ver' from manual kernel list. Use the 'refresh' command to update the ESPs."
|
echo "Removed kernel '$ver' from manual kernel list. Use the 'refresh' command to update the ESPs."
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user