Store and restore settings

Post Reply
matteolucarelli
Posts: 20
Joined: Fri Feb 04, 2022 3:32 pm

Store and restore settings

Post by matteolucarelli »

There's a way to store and reload all camera settings using API?
k.schauwecker
Posts: 123
Joined: Mon Mar 25, 2019 1:12 pm

Re: Store and restore settings

Post by k.schauwecker »

Currently this is not implemented. However, it would be possible to call the web-interface and upload a configuration file. The following batch script does exactly that by calling curl:

Code: Select all

#!/bin/bash

host=192.168.10.10

if [ $# -eq 2 ]; then
	host=$1
	shift
fi

if [ $# -ne 1 ]; then
	echo "Usage: $0 [SCENESCAN-IP] CONF-FILE"
	exit 1
fi

echo "Uploading..."

result=`curl -s -m5 -F "keep_network=1" -F "settings_file=@$1" http://$host/maintenance/ | egrep "(Configuration uploaded)|(Invalid configuration)" | wc -l`

if [ $result -eq 1 ]; then
	echo "Success!"
	exit 0
else
	echo "Upload failed!"
	exit 1
fi
Post Reply