2 # This file is part of Libre-Streamer.
4 # Libre-Streamer is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # Libre-Streamer is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with Libre-Streamer. If not, see <http://www.gnu.org/licenses/>.
17 # Copyright (C) 2014 Nico Cesar
22 echo "usage: $0 elphel_camera_IP_address [config.xml] [/etc/autocampars.xml]"
27 config_file
=config.xml
34 dest_file
=/etc
/autocampars.xml
39 echo -n "pinging $1 ... "
40 ping -c2 $1 > /dev
/null
50 #do an url encode of the file
51 python
-c 'import sys,urllib; print urllib.urlencode([("content",sys.stdin.read())])' < $config_file > /tmp
/tmp_file
54 curl
-0 http
://$1/admin-bin
/editcgi.cgi?
file= -d "save_file=/etc/autocampars.xml" -d "mode=0100644" -d "convert_crlf_to_lf=on" -d '@/tmp/tmp_file' |
grep "Wrote"
59 echo problems loading the config