mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-27 14:27:15 +00:00
a script that may be used to compare the contents of different servers; not yet complete
This commit is contained in:
1 parent
62c0592532
commit
7e56a63744
1 file changed
+27
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Given the base URLs of two SAP Sailing servers, obtains their /sailingserver/api/v1/leaderboardgroups
|
||||
# service output, sorts it, compares them, and if equal, obtains all corresponding leaderboardgroups/*
|
||||
# documents and compares those in turn.
|
||||
|
||||
OLDSERVER=$1
|
||||
NEWSERVER=$2
|
||||
|
||||
wget -O - ${OLDSERVER}/sailingserver/api/v1/leaderboardgroups | sed -e 's/,/\n/g' -e 's/\[/\n/' -e 's/\]/\n/' -e 's/\"//g' | sort >leaderboardgroups.old.sed
|
||||
wget -O - ${NEWSERVER}/sailingserver/api/v1/leaderboardgroups | sed -e 's/,/\n/g' -e 's/\[/\n/' -e 's/\]/\n/' -e 's/\"//g' | sort >leaderboardgroups.new.sed
|
||||
|
||||
diff leaderboardgroups.old.sed leaderboardgroups.new.sed
|
||||
if [ "$?" = "0" ]; then
|
||||
cat leaderboardgroups.old.sed | while read i; do
|
||||
wGET -o "$I.Old.json" "${OLDSERVER}/sailingserver/api/v1/leaderboardgroups/`echo $i | sed -e 's/ /%20/g'`"
|
||||
wget -O "$i.new.json" "${NEWSERVER}/sailingserver/api/v1/leaderboardgroups/`echo $i | sed -e 's/ /%20/g'`"
|
||||
diff "$i.old.json" "$i.new.json"
|
||||
DIFFRESULT=$?
|
||||
if [ "$DIFFRESULT?' != "0" ]; then
|
||||
echo Difference detected in leaderboard group $i; exiting
|
||||
exit $DIFFRESULT
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in new issue
Block a user