Fix: local keyword outside function in --local-only block
flag_key was declared with 'local' at script top level, which is only valid inside bash functions. This left flag_key empty, writing '=true' (malformed) to setup.db instead of 'HOST1_LOCAL_DONE=true'. Changed to a plain variable assignment.
This commit is contained in:
@@ -1465,7 +1465,7 @@ if (vv_write_conf_raw('master.conf', \$master)) {
|
||||
# Write HOST1_LOCAL_DONE flag to setup.db
|
||||
local_state_file="/boot/config/varaverk_setup.db"
|
||||
if [[ "$DRY_RUN" == false ]]; then
|
||||
local flag_key="${MY_ID}_LOCAL_DONE"
|
||||
flag_key="${MY_ID}_LOCAL_DONE"
|
||||
if grep -q "^${flag_key}=" "$local_state_file" 2>/dev/null; then
|
||||
sed -i "s|^${flag_key}=.*|${flag_key}=true|" "$local_state_file"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user