Update main.js.download

This commit is contained in:
Adil Sadqi 2024-04-04 07:39:06 +00:00 committed by GitHub
parent 015ce0cb47
commit 873e71b41f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 1 deletions

View File

@ -182,7 +182,22 @@ function commander(cmd) {
window.open('https://www.google.com');
}, 1000);
break;
case "update":
case "ip":
// Function to fetch the IP address
function getIP(callback){
// Using a free service to fetch the IP address
fetch('https://api.ipify.org?format=json')
.then(response => response.json())
.then(data => callback(data.ip))
.catch(error => callback("Unable to fetch IP address"));
}
// Displaying the IP address
getIP(function(ip){
addLine("Your current IP address is: " + ip, "color2", 80);
});
break;
case "update":
addLine("Opening Updater...", "color2", 80);
setTimeout(function() {
var url = '/update';