mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-19 14:04:17 +03:00
tests: aux.sh check for already present config
'aux lvmconf' detects if new config needs to be regenerated.
This commit is contained in:
parent
32c0dc3549
commit
d426d7e709
@ -1226,6 +1226,18 @@ EOF
|
|||||||
|
|
||||||
lvmconf() {
|
lvmconf() {
|
||||||
unset profile_name
|
unset profile_name
|
||||||
|
test $# -eq 0 || {
|
||||||
|
# Compare if passed args aren't already all in generated lvm.conf
|
||||||
|
local needed=0
|
||||||
|
for i in "$@"; do
|
||||||
|
val=$(grep "${i%%[={ ]*}" CONFIG_VALUES 2>/dev/null | tail -1) || { needed=1; break; }
|
||||||
|
test "$val" = "$i" || { needed=1; break; }
|
||||||
|
done
|
||||||
|
test "$needed" -eq 0 && {
|
||||||
|
echo "## LVMCONF: values are already there, skipping."
|
||||||
|
return 0 # not needed
|
||||||
|
}
|
||||||
|
}
|
||||||
generate_config "$@"
|
generate_config "$@"
|
||||||
mv -f CONFIG "$LVM_SYSTEM_DIR/lvm.conf"
|
mv -f CONFIG "$LVM_SYSTEM_DIR/lvm.conf"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user