]> git.proxmox.com Git - pve-installer.git/commit - unconfigured.sh
unconfigured: fix getting swap devices
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 14 Jun 2021 10:35:04 +0000 (12:35 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 14 Jun 2021 10:35:11 +0000 (12:35 +0200)
commit20d20ee3590d0fa5e8b93702e37aa2b550314044
tree2baf94371d9c22a1bc646fdd570669757ed6d128
parent408dc55fe7f8878338fd95b7afd7f625922ef8e9
unconfigured: fix getting swap devices

Previously we used a ugly hack to extract the device from the whole
line returned by passing it to bash's `set`, which assigns remaining
arguments it does not know about (or after "--") to $1, $2, etc.

This is ugly due to:
* not using "--", so it could break easily
* being quite subtle in general, e.g., shellcheck does not likes
  unquoted variable expansions, so one would add quotes around
  breaking the actual use case

Just use awk to do both the grep and extraction, which is much
clearer to do

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
unconfigured.sh