-
Notifications
You must be signed in to change notification settings - Fork 1
/
frpc
executable file
·34 lines (29 loc) · 899 Bytes
/
frpc
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
#!/bin/sh
contains(){
case "$2" in
*$1*) return 0;;
*) return 1;;
esac
}
if [[ "$#" -gt 0 ]]; then
if contains "$1 " "help http https stcp sudp tcp tcpmux udp xtcp "; then
/bin/_frpc $@
exit $?
fi
fi
IFS="= "
echo "[common]" >> /frpc.ini
while [[ "$#" -gt 0 ]]; do
case $1 in
-h|--help) /bin/_frpc --help; exit ;;
-s|--server_addr) echo "server_addr = $2" >> /frpc.ini; shift ;;
-p|--server_port) echo "server_port = $2" >> /frpc.ini; shift ;;
-l|--admin_addr) echo "admin_addr = $2" >> /frpc.ini; shift ;;
-u|--admin_port) echo "admin_port = $2" >> /frpc.ini; shift ;;
-t|--token) echo "token = $2" >> /frpc.ini; shift ;;
--*=*) k=${1:2} && echo "${k%=*} = ${k#*=}" >> /frpc.ini ;;
--*) echo "${1:2} = $2" >> /frpc.ini; shift ;;
esac
shift
done
/bin/_frpc -c /frpc.ini