支持一键打包spk
This commit is contained in:
BIN
source/gofrpc/bin/arch/frpc_arm
Executable file
BIN
source/gofrpc/bin/arch/frpc_arm
Executable file
Binary file not shown.
BIN
source/gofrpc/bin/arch/frpc_arm64
Executable file
BIN
source/gofrpc/bin/arch/frpc_arm64
Executable file
Binary file not shown.
BIN
source/gofrpc/bin/arch/frpc_x64
Executable file
BIN
source/gofrpc/bin/arch/frpc_x64
Executable file
Binary file not shown.
BIN
source/gofrpc/bin/arch/frpc_x86
Executable file
BIN
source/gofrpc/bin/arch/frpc_x86
Executable file
Binary file not shown.
24
source/gofrpc/bin/frpc.ini
Normal file
24
source/gofrpc/bin/frpc.ini
Normal file
@ -0,0 +1,24 @@
|
||||
[common]
|
||||
admin_addr = 0.0.0.0
|
||||
admin_port = 8760
|
||||
server_addr = 47.111.117.185
|
||||
server_port = 2680
|
||||
token = 64590757cf05
|
||||
|
||||
#[template_ssh]
|
||||
#type = tcp
|
||||
#local_ip = 127.0.0.1
|
||||
#local_port = 22
|
||||
#remote_port = 50341
|
||||
#
|
||||
#[template_web]
|
||||
#type = http
|
||||
#local_ip = 127.0.0.1
|
||||
#local_port = 5000
|
||||
#custom_domains = template.nas.config
|
||||
#
|
||||
#[template_frpc_web]
|
||||
#type = http
|
||||
#local_ip = 127.0.0.1
|
||||
#local_port = 8760
|
||||
#custom_domains = template.self.web.config
|
47
source/gofrpc/bin/frpc_monitor
Normal file
47
source/gofrpc/bin/frpc_monitor
Normal file
@ -0,0 +1,47 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPTPATH="${0%/*}"
|
||||
cd "${SCRIPTPATH}/.."
|
||||
APPPATH="$(pwd)"
|
||||
APPNAME="frpc"
|
||||
ARCHBINPATH="${APPPATH}/bin/arch"
|
||||
BINPATH="${APPPATH}/bin/${APPNAME}"
|
||||
|
||||
_arch_select() {
|
||||
${BINPATH} -v && return 0
|
||||
ls -1 ${ARCHBINPATH}/ | while read archbin
|
||||
do
|
||||
${ARCHBINPATH}/${archbin} -v && {
|
||||
ln -sf ${ARCHBINPATH}/${archbin} ${BINPATH}
|
||||
break
|
||||
}
|
||||
done
|
||||
[ -f ${BINPATHA} ] || return 2
|
||||
}
|
||||
|
||||
_start() {
|
||||
CONFPATH="${APPPATH}/bin/frpc.ini"
|
||||
"${BINPATH}" -c "${CONFPATH}" >/dev/null &
|
||||
}
|
||||
|
||||
_stop() {
|
||||
kill -9 "$(pidof ${APPNAME})"
|
||||
kill -11 "$(pidof ${APPNAME})"
|
||||
}
|
||||
|
||||
_monitor() {
|
||||
pidof "${APPNAME}" 2>/dev/null
|
||||
if [ $? -ne 0 ] ; then
|
||||
_stop
|
||||
_start
|
||||
fi
|
||||
}
|
||||
|
||||
## main start
|
||||
inter=5
|
||||
_arch_select || exit 2
|
||||
while [ 1 -eq 1 ]
|
||||
do
|
||||
_monitor
|
||||
sleep "${inter}"
|
||||
done
|
Reference in New Issue
Block a user