#!/bin/bash # Dump the Hungarian dashboard pages so 0.251.0 and 0.252.0 can be compared byte by byte. IP=172.17.0.2:8080 H="Host: felhom.enkisfelhom.hu" PW=$(cat /tmp/.felhompw); J=/tmp/pj.txt; rm -f $J curl -s -c $J -H "$H" "http://$IP/login" -o /tmp/lg.html CSRF=$(grep -o 'name="_csrf" value="[^"]*"' /tmp/lg.html | head -1 | sed 's/.*value="//;s/"//') SESS=$(curl -s -b $J -H "$H" -D - -o /dev/null -X POST "http://$IP/login" \ --data-urlencode "password=$PW" --data-urlencode "_csrf=$CSRF" \ | grep -i '^set-cookie: felhom_session' | head -1 | sed 's/[Ss]et-[Cc]ookie: //;s/;.*//') [ -z "$SESS" ] && { echo "LOGIN FAILED"; exit 1; } OUT=/tmp/hu_pages; rm -rf $OUT; mkdir -p $OUT for P in launcher backups backups/remote backups/apps backups/restore monitoring settings storage sharing stacks; do F=$(echo $P | tr '/' '_') curl -s -H "$H" -H "Cookie: $SESS" --max-time 10 "http://$IP/$P?lang=hu" -o $OUT/$F.html done curl -s -H "$H" --max-time 10 "http://$IP/login?lang=hu" -o $OUT/login.html cd $OUT && wc -c *.html