File size: 455 Bytes
885214f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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