Jsni299j / entrypoint.sh
TomatoFull's picture
Create entrypoint.sh
885214f verified
raw
history blame
455 Bytes
#!/bin/sh
if [ -z "$PRIVATE_KEY" ] || [ -z "$PUBLIC_KEY" ]; then
exit 1
fi
envsubst < /app/wg0.conf.template > /app/wg0.conf
openrc
rc-service i2p start
sleep 10
HOSTNAME=$(cat /var/lib/i2p/eepsite/hostname)
/usr/local/bin/wireguard-go -f /app/wg0.conf --port 57777 &
(while true; do echo -e "HTTP/1.1 200 OK\r\nContent-Length: $(echo -n "Hello World: $HOSTNAME:57777" | wc -c)\r\n\r\nHello World: $HOSTNAME:57777"; sleep 1; done) | nc -l -p 7860