further refined server comparison script

This commit is contained in:
Axel Uhl committed 2015-03-10 01:07:47 +01:00
1 parent 4fac31b8ab
commit 9eabc3bd5e
1 file changed
+6 -2
+6 -2
View File
@@ -37,6 +37,10 @@ if [ "$continue" != "1" ]; then
wget $WGET_QUIET -O - ${NEWSERVER}/sailingserver/api/v1/leaderboardgroups | sed -e 's/,/\n/g' -e 's/\[/\n/' -e 's/\]/\n/' -e 's/\"//g' | grep -v "^$" | sort >$NEWGROUPS
fi
download_and_fix_boatclasses () {
wget $WGET_QUIET -O - "$1/sailingserver/api/v1/leaderboardgroups/`echo $OLD_LB | sed -e 's/ /%20/g'`" | sed -e 's/\b470W\b/470/g' -e 's/\b470M\b/470/g' -e 's/\<505\>/5O5/g' -e 's/Laser Int\./Laser/g' -e 's/J-24/J\/24/g' -e 's/\([^ ]\)Radial/\1Laser Radial/g' -e 's/J80/J\/80/g' -e 's/12mR/12 Meter/g' -e 's/Extreme40/Extreme 40/g' -e 's/Drachen/Dragon Int\./g' -e 's/TORNADO/Tornado Catamaran/g' -e 's/Melges24/Melges 24/g' -e 's/RAD W/RADW/g' -e 's/B25/Platu 25/g' -e 's/Europe\([^ ]\)/Europe Int\.\1/g' | python -m json.tool | sed -e 's/\("timepoint" *: *\)"[^"]*"/\1""/g' >"$2" 2>$WGET_ERR
}
diff leaderboardgroups.old.sed leaderboardgroups.new.sed
if [ "$?" = "0" ]; then
exec 3<> $OLDGROUPS
@@ -47,8 +51,8 @@ if [ "$?" = "0" ]; then
if [ "$list" = "1" ]; then
echo " * $OLD_LB"
fi
wget $WGET_QUIET -O - "${OLDSERVER}/sailingserver/api/v1/leaderboardgroups/`echo $OLD_LB | sed -e 's/ /%20/g'`" | sed -e 's/\b470W\b/470/g' -e 's/\b470M\b/470/g' -e 's/\<505\>/5O5/g' -e 's/Laser Int\./Laser/g' -e 's/J-24/J\/24/g' -e 's/[^ ]Radial/Laser Radial/g' -e 's/J80/J\/80/g' -e 's/12mR/12 Meter/g' -e 's/Extreme40/Extreme 40/g' -e 's/Drachen/Dragon Int\./g' -e 's/TORNADO/Tornado Catamaran/g' -e 's/Melges24/Melges 24/g' -e 's/RAD W/RADW/g' -e 's/B25/Platu 25/g' -e 's/Europe[^ ]/Europe Int\./g' | python -m json.tool | grep -v timepoint >"${OLD_LB}.old.json" 2>$WGET_ERR
wget $WGET_QUIET -O - "${NEWSERVER}/sailingserver/api/v1/leaderboardgroups/`echo $NEW_LB | sed -e 's/ /%20/g'`" | sed -e 's/\b470W\b/470/g' -e 's/\b470M\b/470/g' -e 's/\<505\>/5O5/g' -e 's/Laser Int\./Laser/g' -e 's/J-24/J\/24/g' -e 's/[^ ]Radial/Laser Radial/g' -e 's/J80/J\/80/g' -e 's/12mR/12 Meter/g' -e 's/Extreme40/Extreme 40/g' -e 's/Drachen/Dragon Int\./g' -e 's/TORNADO/Tornado Catamaran/g' -e 's/Melges24/Melges 24/g' -e 's/RAD W/RADW/g' -e 's/B25/Platu 25/g' -e 's/Europe[^ ]/Europe Int\./g' | python -m json.tool | grep -v timepoint >"${NEW_LB}.new.json" 2>$WGET_ERR
download_and_fix_boatclasses "${OLDSERVER}" "${OLD_LB}.old.json"
download_and_fix_boatclasses "${NEWSERVER}" "${NEW_LB}.new.json"
diff -b -i -B "${OLD_LB}.old.json" "${NEW_LB}.new.json"
DIFFRESULT=$?
if [ "$DIFFRESULT" != "0" ]; then