Skip to content

Commit

Permalink
Submit has been renamed to download under 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsoft committed Apr 5, 2018
1 parent 3bd31e8 commit b0d843c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions doBackup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ password=$3;
csrf=$(curl -Ss --insecure --cookie-jar /tmp/$hostname-cookies.txt https://$hostname/diag_backup.php | sed -n 's/.*name=.__csrf_magic. value="\([^"]*\)".*/\1/p')
csrf2=$(curl -Ss --insecure --location --cookie-jar /tmp/$hostname-cookies.txt --cookie /tmp/$hostname-cookies.txt --data "login=Login&usernamefld=$username&passwordfld=$password&__csrf_magic=$csrf" https://$hostname/diag_backup.php | sed -n 's/.*var csrfMagicToken = "\([^"]*\)".*/\1/p')

curl -Ss --insecure --cookie /tmp/$hostname-cookies.txt --cookie-jar /tmp/$hostname-cookies.txt --data "Submit=download&donotbackuprrd=yes&__csrf_magic=$csrf2" https://$hostname/diag_backup.php > config-router-`date +%Y%m%d%H%M%S`.xml
curl -Ss --insecure --cookie /tmp/$hostname-cookies.txt --cookie-jar /tmp/$hostname-cookies.txt --data "download=download&donotbackuprrd=yes&__csrf_magic=$csrf2" https://$hostname/diag_backup.php > config-router-`date +%Y%m%d%H%M%S`.xml

rm /tmp/$hostname-cookies.txt;
rm /tmp/$hostname-cookies.txt;

0 comments on commit b0d843c

Please sign in to comment.