Besuche unser Club Projekt (hier klicken), wo unter anderem kommende Events angekündigt werden.

...
 
Commits (2)
#!/bin/bash
# show commands
set -x
# switch to the directory which contains this script
cd "$(dirname "$0")"
# copy service definition
sudo cp system-unit.service /etc/systemd/system/awesome-timeserver.service
# ask systemd to reload the service list
sudo systemctl daemon-reload
# (re)start service
sudo systemctl restart awesome-timeserver
# show service status
sudo systemctl status awesome-timeserver
HTTP/1.1 200 OK
Server: awesome-netcat-server
Content-Type: application/json; charset=utf-8
Connection: close
X-Custom-Header: this is a custom header. Nice thing, right?
{
"date": "##DATE##"
}
#!/bin/bash
# switch to the directory which contains this script
cd "$(dirname "$0")"
# loop endless...
while true
do
# take the content of the text file...
# replace ##DATE## inside of the file with the real date
# wait for a request on port 8080 and answer
cat response-template.txt | \
sed "s/##DATE##/$(date)/g" | \
nc -l 127.0.0.1 8080 -N
done
[Unit]
Description=Awesome Timeserver
After=network.target
[Service]
ExecStart=/home/pi/webserver-workshop/netcat-server/server.sh
Restart=on-failure
Type=simple
[Install]
WantedBy=multi-user.target
Alias=awesome-timeserver.service