fix: inject storage path into existing config, explain interactive vs piped
This commit is contained in:
parent
e61aab2df5
commit
6f0576d534
1 changed files with 3 additions and 4 deletions
7
setup.sh
7
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue