diff options
Diffstat (limited to 'bin/osm/osm.api.changeset.create')
-rwxr-xr-x | bin/osm/osm.api.changeset.create | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/osm/osm.api.changeset.create b/bin/osm/osm.api.changeset.create new file mode 100755 index 0000000..ab9fe85 --- /dev/null +++ b/bin/osm/osm.api.changeset.create | |||
@@ -0,0 +1,25 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e | ||
4 | |||
5 | read -e -p 'Type comment: ' -r comment </dev/tty | ||
6 | if [ -z $OSM_USER_PASSWD ]; then | ||
7 | read -e -p 'Type USER:PASSWD: ' -r OSM_USER_PASSWD </dev/tty | ||
8 | fi | ||
9 | |||
10 | info="<osm> | ||
11 | <changeset> | ||
12 | <tag k='comment' v='$comment'/> | ||
13 | <tag k='created_by' v='bash script'/> | ||
14 | <tag k='bot' v='yes'/> | ||
15 | </changeset> | ||
16 | </osm> | ||
17 | " | ||
18 | |||
19 | changeset_id=$(echo $info |\ | ||
20 | curl -u $OSM_USER_PASSWD --upload-file - $OSM_API/changeset/create |\ | ||
21 | tail -1) | ||
22 | |||
23 | echo >/dev/tty | ||
24 | echo "changeset created, check $OSM_SERVER/changeset/$changeset_id" >/dev/tty | ||
25 | echo $changeset_id | tee /tmp/changeset && echo copied to /tmp/changeset | ||