forked from zhangsean/docker-frp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·40 lines (40 loc) · 1.08 KB
/
Copy pathentrypoint.sh
File metadata and controls
executable file
·40 lines (40 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
if [ -z $MODE ]; then
MODE=server
fi
if [ $FRP_TOKEN ]; then
sed -i "1 a token = $FRP_TOKEN" /frp/frps.ini
sed -i "1 a token = $FRP_TOKEN" /frp/frpc.ini
fi
if [ $MODE = server ]; then
if [ $BIND_PORT ]; then
sed -i "s|bind_port = 7000|bind_port = $BIND_PORT|g" /frp/frps.ini
fi
/frp/frps -c /frp/frps.ini
else
if [ $SERVER_ADDR ]; then
sed -i "s|server_addr = 127.0.0.1|server_addr = $SERVER_ADDR|g" /frp/frpc.ini
fi
if [ $FRP_USER ]; then
sed -i "1 a user = $FRP_USER" /frp/frpc.ini
fi
if [ $PROXY_NAME ]; then
sed -i "s|ssh|$PROXY_NAME|g" /frp/frpc.ini
fi
if [ $SERVER_PORT ]; then
sed -i "s|server_port = 7000|server_port = $SERVER_PORT|g" /frp/frpc.ini
fi
if [ $PROTO ]; then
sed -i "s|type = tcp|type = $PROTO|g" /frp/frpc.ini
fi
if [ $LOCAL_IP ]; then
sed -i "s|local_ip = 127.0.0.1|local_ip = $LOCAL_IP|g" /frp/frpc.ini
fi
if [ $LOCAL_PORT ]; then
sed -i "s|local_port = 22|local_port = $LOCAL_PORT|g" /frp/frpc.ini
fi
if [ $REMOTE_PORT ]; then
sed -i "s|remote_port = 6000|remote_port = $REMOTE_PORT|g" /frp/frpc.ini
fi
/frp/frpc -c /frp/frpc.ini
fi