Skip to content

Commit

Permalink
auto redirect when decrypted
Browse files Browse the repository at this point in the history
  • Loading branch information
dadav committed Apr 18, 2020
1 parent 44e1e79 commit 35ea36e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions builder/data/usr/bin/decryption-webserver
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@ POST_RESPONSE = """
text-align: center;
}
</style>
<script type="text/javascript">
function checkPwnagotchi() {
var xhr = new XMLHttpRequest();
xhr.open('GET', document.location.hostname + ':8080/');
xhr.onload = function () {
console.log('DONE: ', xhr.status);
};
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
window.location.replace("http://" + document.location.hostname + ':8080/');
}else{
setTimeout(checkPwnagotchi, 1000);
}
}
};
xhr.send();
}
setTimeout(checkPwnagotchi, 1000);
</script>
</head>
<body style="margin:0;">
Expand Down

0 comments on commit 35ea36e

Please sign in to comment.