I just checjed Bing to see if Microsoft was in such bad shapet today. asked it to make a bash shell script. looks ok to me :

Sure! Here’s a simple Bash script to create a web server without using Python. This script uses netcat (nc) to serve the HTML content:

#!/bin/bash

Create the HTML file

echo “<html> <head> <title>Announcement</title> </head> <body> <h1>The problems are temporary and not catastrophic. Full service will be restored soon.</h1> </body> </html>” > /tmp/announcement.html

Start a simple web server using netcat

while true; do { echo -ne “HTTP/1.1 200 OK\r\nContent-Length: $(wc -c < /tmp/announcement.html)\r\nContent-Type: text/html\r\n\r\n”; cat /tmp/announcement.html; } | nc -l -p 8080 -q 1; done

This script will continuously listen on port 8080 and serve the HTML file. You can stop the server by pressing Ctrl+C.

Let me know if you need any further assistance!

  • A_A@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    7 months ago

    #!/bin/bash

    looks like linux : is it ?

    I just checjed Bing

    could you “checjed” again 🤣 ?

    HTML file update :
    “On second thought it is indeed a catastrophe”