Spaces:
Running
Running
TomatoFull
commited on
Commit
•
885214f
1
Parent(s):
526ad23
Create entrypoint.sh
Browse files- entrypoint.sh +16 -0
entrypoint.sh
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
|
3 |
+
if [ -z "$PRIVATE_KEY" ] || [ -z "$PUBLIC_KEY" ]; then
|
4 |
+
exit 1
|
5 |
+
fi
|
6 |
+
|
7 |
+
envsubst < /app/wg0.conf.template > /app/wg0.conf
|
8 |
+
|
9 |
+
openrc
|
10 |
+
rc-service i2p start
|
11 |
+
sleep 10
|
12 |
+
|
13 |
+
HOSTNAME=$(cat /var/lib/i2p/eepsite/hostname)
|
14 |
+
|
15 |
+
/usr/local/bin/wireguard-go -f /app/wg0.conf --port 57777 &
|
16 |
+
(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
|