diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2015-03-01 21:25:59 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-04 20:46:01 +0100 |
commit | 48e78cf6fd04b6086f4bcb04703fad936c35f56c (patch) | |
tree | 7ba0de7a3d773c770e5f18539295febdaf269e64 /util | |
parent | 90105d546826498603eb6db1999ada92dca08b82 (diff) | |
download | coreboot-48e78cf6fd04b6086f4bcb04703fad936c35f56c.tar.gz coreboot-48e78cf6fd04b6086f4bcb04703fad936c35f56c.tar.bz2 coreboot-48e78cf6fd04b6086f4bcb04703fad936c35f56c.zip |
board-status: update mediawiki interface
Our Mediawiki instance doesn't accept the old txt format anymore.
Change-Id: I94b9f5366900ec8e192abab3ed716dbced4fc4f7
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/8567
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util')
-rwxr-xr-x | util/board_status/to-wiki/push-to-wiki.sh | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/util/board_status/to-wiki/push-to-wiki.sh b/util/board_status/to-wiki/push-to-wiki.sh index ad339931e555..7c677269b1b1 100755 --- a/util/board_status/to-wiki/push-to-wiki.sh +++ b/util/board_status/to-wiki/push-to-wiki.sh @@ -22,12 +22,10 @@ CR=$(curl -sS \ --compressed \ --data-urlencode "lgname=${USERNAME}" \ --data-urlencode "lgpassword=${USERPASS}" \ - --request "POST" "${WIKIAPI}?action=login&format=txt") + --request "POST" "${WIKIAPI}?action=login&format=json") -CR2=($CR) -if [ "${CR2[9]}" = "[token]" ]; then - TOKEN=${CR2[11]} -else +TOKEN=`echo $CR| sed -e 's,^.*"token":"\([^"]*\)".*$,\1,'` +if [ -z "$TOKEN" ]; then exit fi @@ -44,7 +42,7 @@ CR=$(curl -sS \ --data-urlencode "lgname=${USERNAME}" \ --data-urlencode "lgpassword=${USERPASS}" \ --data-urlencode "lgtoken=${TOKEN}" \ - --request "POST" "${WIKIAPI}?action=login&format=txt") + --request "POST" "${WIKIAPI}?action=login&format=json") ############### #Get edit token @@ -57,10 +55,10 @@ CR=$(curl -sS \ --header "Accept-Language: en-us" \ --header "Connection: keep-alive" \ --compressed \ - --request "POST" "${WIKIAPI}?action=tokens&format=txt") + --request "POST" "${WIKIAPI}?action=query&meta=tokens&format=json") -CR2=($CR) -EDITTOKEN=${CR2[8]} +EDITTOKEN=`echo $CR| sed -e 's,^.*"csrftoken":"\([^"]*\)".*$,\1,'` +EDITTOKEN=`printf "$EDITTOKEN"` if [ ${#EDITTOKEN} != 34 ]; then exit fi |