fix: inject storage path into existing config, explain interactive vs piped

This commit is contained in:
Claus Lohmar 2026-08-06 14:15:13 +01:00
parent e61aab2df5
commit 6f0576d534

View file

@ -229,13 +229,12 @@ log "Step 6/7: Configuration..."
if [ ! -f "${DEPLOY_DIR}/config.yaml" ]; then if [ ! -f "${DEPLOY_DIR}/config.yaml" ]; then
cp config.yaml "${DEPLOY_DIR}/config.yaml" 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}" log "Default config.yaml created with storage path: ${STORAGE_PATH}"
info "Edit it to match your cameras: nano ${DEPLOY_DIR}/config.yaml"
else else
log "config.yaml already exists — preserved." log "config.yaml already exists — updating storage path to: ${STORAGE_PATH}"
fi 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 mkdir -p "${STORAGE_PATH}" 2>/dev/null || mkdir -p "${STORAGE_PATH}"
sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}" 2>/dev/null || true sudo chown "$(whoami):$(id -gn)" "${STORAGE_PATH}" 2>/dev/null || true