Page 1 of 1

Store and restore settings

Posted: Tue Jul 05, 2022 2:21 pm
by matteolucarelli
There's a way to store and reload all camera settings using API?

Re: Store and restore settings

Posted: Tue Jul 05, 2022 4:30 pm
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