diff --git a/index_files/main.js.download b/index_files/main.js.download index 4d3c801..95c1a01 100644 --- a/index_files/main.js.download +++ b/index_files/main.js.download @@ -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';