benhylau / mesh-workshop

Nodes used to facilitate workshops and demos for mesh networking
GNU General Public License v3.0
35 stars 2 forks source link

Simplify running of webserver #6

Closed benhylau closed 6 years ago

benhylau commented 6 years ago

Simplify the typing in: https://github.com/benhylau/mesh-workshop/#7-send-text-messages-with-nc

Put these into a script and copy the script over to home like how docker archives are done:

while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; echo -e "You have reached $(cat /etc/hostname) on $(date)"; } | nc -l -p 80; done
ps aux | grep '[nc] -l -p 80' | awk '{ print $2 }' | xargs -n 1 kill -9

In the steps, cat the files to see what the script does. @darkdrgn2k is ^ okay?

benhylau commented 6 years ago

@darkdrgn2k See if this looks better? https://github.com/benhylau/mesh-workshop/blob/simplify-webserver/README.md#7-send-text-messages-with-nc

I intentionally make it a sh without exec perm so the user can run it with sh and cat the content.