From 7d4994f317f700781043268ea9a20dd41ca0e5da Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sat, 30 May 2026 20:00:54 -0400 Subject: [PATCH] Local onboard: set PARTNERSHIP_ENABLED=true in master.conf + push When HOST1 completes its local setup (--onboard --local-only), enable the partnership in master.conf so sync scripts start functioning immediately. Pushes the updated master.conf to all listed hosts via vv_push_master_conf(). --- Partnership/partnership_manager.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Partnership/partnership_manager.sh b/Partnership/partnership_manager.sh index 7c390c9..9e6a47e 100644 --- a/Partnership/partnership_manager.sh +++ b/Partnership/partnership_manager.sh @@ -1434,6 +1434,35 @@ if [[ "$MODE" == "onboard" ]]; then log "FolderView3 not configured — skipping" fi + # Enable partnership in master.conf + push to all hosts + echo "" + echo "Enabling partnership in master.conf..." + if [[ "$DRY_RUN" == false ]]; then + if command -v php &>/dev/null; then + php -r " +require_once '/usr/local/emhttp/plugins/varaverk/include/config.php'; +\$master = vv_read_conf_raw('master.conf'); +\$master = preg_replace('/^\s*PARTNERSHIP_ENABLED\s*=.*/m', 'PARTNERSHIP_ENABLED=true', \$master); +if (vv_write_conf_raw('master.conf', \$master)) { + \$results = vv_push_master_conf(); + foreach (\$results as \$r) { + echo \$r['host'] . ': ' . (\$r['ok'] ? 'pushed' : 'FAILED — ' . \$r['error']) . PHP_EOL; + } + echo 'PARTNERSHIP_ENABLED=true' . PHP_EOL; +} else { + echo 'write_failed' . PHP_EOL; +} +" 2>/dev/null | grep -v '^$' | while IFS= read -r line; do + [[ "$line" == "PARTNERSHIP_ENABLED=true" ]] && log "PARTNERSHIP_ENABLED=true in master.conf ✅" || log "$line" + done + else + warn "php not available — set PARTNERSHIP_ENABLED=true in master.conf manually" + fi + else + warn "DRY RUN — would set PARTNERSHIP_ENABLED=true in master.conf and push" + fi + + # 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"