diff --git a/setup.sh b/setup.sh index 826ec5a..6d5e5ca 100755 --- a/setup.sh +++ b/setup.sh @@ -229,13 +229,12 @@ log "Step 6/7: Configuration..." if [ ! -f "${DEPLOY_DIR}/config.yaml" ]; then cp config.yaml "${DEPLOY_DIR}/config.yaml" - # Inject the user's storage path into the config. - sed -i "s|recordings_path:.*|recordings_path: \"${STORAGE_PATH}\"|" "${DEPLOY_DIR}/config.yaml" log "Default config.yaml created with storage path: ${STORAGE_PATH}" - info "Edit it to match your cameras: nano ${DEPLOY_DIR}/config.yaml" else - log "config.yaml already exists — preserved." + log "config.yaml already exists — updating storage path to: ${STORAGE_PATH}" fi +# Always inject the chosen storage path into config. +sed -i "s|recordings_path:.*|recordings_path: \"${STORAGE_PATH}\"|" "${DEPLOY_DIR}/config.yaml" sudo mkdir -p "${STORAGE_PATH}" 2>/dev/null || mkdir -p "${STORAGE_PATH}" sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}" 2>/dev/null || true