Skip to content

Commit

Permalink
Issue #564: curl behaves better than wget
Browse files Browse the repository at this point in the history
  • Loading branch information
gotthardp committed Feb 15, 2019
1 parent 4cf0212 commit cf0a736
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions scripts/dbexport
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash
SERVER="localhost:8080"
AUTH="--user=admin --password=admin"
AUTH="admin:admin"

DIR=backup-$(date +"%Y%m%d-%H%M%S")
mkdir -p $DIR

for db in config users areas gateways multicast_channels networks groups profiles devices nodes ignored_nodes handlers connectors; do
wget -4nv $AUTH --output-document=$DIR/$db.json http://$SERVER/api/$db
curl --digest -u $AUTH --output $DIR/$db.json http://$SERVER/api/$db
done
4 changes: 2 additions & 2 deletions scripts/dbimport
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
SERVER="localhost:8080"
AUTH="--user=admin --password=admin"
AUTH="admin:admin"

if [ -z "$1" ]; then
DIR="."
Expand All @@ -9,5 +9,5 @@ else
fi

for f in $DIR/*.json; do
wget -4nv $AUTH --header=Content-Type:application/json --post-file=$f http://$SERVER/api/$(basename $f .json)
curl --digest -u $AUTH --header Content-Type:application/json --data @$f http://$SERVER/api/$(basename $f .json)
done

0 comments on commit cf0a736

Please sign in to comment.