diff options
| author | Hsieh Chin Fan <typebrook@gmail.com> | 2020-12-24 11:45:56 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <typebrook@gmail.com> | 2020-12-24 11:45:56 +0800 |
| commit | 16e06c725c0e864c225353c96334b651d5657194 (patch) | |
| tree | 99ddae182f32a07120ed4e73de3d64cb5cb8750a /tools/osm | |
| parent | c196be2090109359c4baf9f5521cc4aefd9243bf (diff) | |
update
Diffstat (limited to 'tools/osm')
| -rwxr-xr-x | tools/osm/osm.api.changeset.commit | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/osm/osm.api.changeset.commit b/tools/osm/osm.api.changeset.commit index 5182e3b..5861750 100755 --- a/tools/osm/osm.api.changeset.commit +++ b/tools/osm/osm.api.changeset.commit | |||
| @@ -15,11 +15,11 @@ if [ -z ${OSM_USER_PASSWD} ]; then | |||
| 15 | read -e -p 'Type USER:PASSWD: ' -r OSM_USER_PASSWD </dev/tty | 15 | read -e -p 'Type USER:PASSWD: ' -r OSM_USER_PASSWD </dev/tty |
| 16 | fi | 16 | fi |
| 17 | 17 | ||
| 18 | # Create changeset with given information | 18 | create_changeset() { |
| 19 | curl ${OSM_API}/changeset/create \ | 19 | curl ${OSM_API}/changeset/create \ |
| 20 | --user ${OSM_USER_PASSWD} \ | 20 | --user ${OSM_USER_PASSWD} \ |
| 21 | --upload-file - \ | 21 | --upload-file - \ |
| 22 | <<EOF | tail -1 | changeset_id=$(cat) | 22 | <<EOF | tail -1 |
| 23 | <osm> | 23 | <osm> |
| 24 | <changeset> | 24 | <changeset> |
| 25 | <tag k='comment' v='${comment}'/> | 25 | <tag k='comment' v='${comment}'/> |
| @@ -28,6 +28,10 @@ curl ${OSM_API}/changeset/create \ | |||
| 28 | </changeset> | 28 | </changeset> |
| 29 | </osm> | 29 | </osm> |
| 30 | EOF | 30 | EOF |
| 31 | } | ||
| 32 | |||
| 33 | # Create changeset with given information | ||
| 34 | changeset_id=$(create_changeset) | ||
| 31 | 35 | ||
| 32 | # Print created changeset id | 36 | # Print created changeset id |
| 33 | echo >/dev/tty | 37 | echo >/dev/tty |