mirror of
https://github.com/snltty/linker.git
synced 2025-12-17 17:06:47 +08:00
197
This commit is contained in:
BIN
install-package/fpk/fbin/ICON.PNG
Normal file
BIN
install-package/fpk/fbin/ICON.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
install-package/fpk/fbin/ICON_256.PNG
Normal file
BIN
install-package/fpk/fbin/ICON_256.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
install-package/fpk/fbin/app/.DS_Store
vendored
Normal file
BIN
install-package/fpk/fbin/app/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
install-package/fpk/fbin/app/ui/.DS_Store
vendored
Normal file
BIN
install-package/fpk/fbin/app/ui/.DS_Store
vendored
Normal file
Binary file not shown.
13
install-package/fpk/fbin/app/ui/config
Normal file
13
install-package/fpk/fbin/app/ui/config
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
".url": {
|
||||
"linker.Application": {
|
||||
"title": "linker",
|
||||
"icon": "images/icon_{0}.png",
|
||||
"type": "url",
|
||||
"protocol": "",
|
||||
"port": "1804",
|
||||
"url": "/",
|
||||
"allUsers": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
install-package/fpk/fbin/app/ui/images/.DS_Store
vendored
Normal file
BIN
install-package/fpk/fbin/app/ui/images/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
install-package/fpk/fbin/app/ui/images/icon_256.png
Normal file
BIN
install-package/fpk/fbin/app/ui/images/icon_256.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
install-package/fpk/fbin/app/ui/images/icon_64.png
Normal file
BIN
install-package/fpk/fbin/app/ui/images/icon_64.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
5
install-package/fpk/fbin/cmd/config_callback
Normal file
5
install-package/fpk/fbin/cmd/config_callback
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called after the user change environment variables in application setting page.
|
||||
|
||||
exit 0
|
||||
5
install-package/fpk/fbin/cmd/config_init
Normal file
5
install-package/fpk/fbin/cmd/config_init
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called before the user change environment variables in application setting page.
|
||||
|
||||
exit 0
|
||||
5
install-package/fpk/fbin/cmd/install_callback
Normal file
5
install-package/fpk/fbin/cmd/install_callback
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called after the user installs the application.
|
||||
|
||||
exit 0
|
||||
5
install-package/fpk/fbin/cmd/install_init
Normal file
5
install-package/fpk/fbin/cmd/install_init
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called before the user installs the application.
|
||||
|
||||
exit 0
|
||||
108
install-package/fpk/fbin/cmd/main
Normal file
108
install-package/fpk/fbin/cmd/main
Normal file
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
LOG_FILE="${TRIM_PKGVAR}/info.log"
|
||||
PID_FILE="${TRIM_PKGVAR}/app.pid"
|
||||
|
||||
# write the command to start your program here
|
||||
CMD="chmod +x ${TRIM_APPDEST}/server/linker;${TRIM_APPDEST}/server/linker"
|
||||
|
||||
log_msg() {
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> ${LOG_FILE}
|
||||
}
|
||||
|
||||
start_process() {
|
||||
if status; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log_msg "Starting process ..."
|
||||
# run cmd to start process
|
||||
bash -c "${CMD}" >> ${LOG_FILE} 2>&1 &
|
||||
# write pid to pidfile
|
||||
printf "%s" "$!" > ${PID_FILE}
|
||||
# log_msg "CMD = ${CMD}"
|
||||
# log_msg "pid = $!"
|
||||
return 0
|
||||
}
|
||||
|
||||
stop_process() {
|
||||
log_msg "Stopping process ..."
|
||||
|
||||
if [ -r "${PID_FILE}" ]; then
|
||||
pid=$(head -n 1 "${PID_FILE}" | tr -d '[:space:]')
|
||||
|
||||
log_msg "pid=${pid}"
|
||||
if ! check_process "${pid}"; then
|
||||
# process not exist, delete pidfile
|
||||
rm -f "${PID_FILE}"
|
||||
log_msg "remove pid file 1"
|
||||
return
|
||||
fi
|
||||
|
||||
log_msg "send TERM signal to PID:${pid}..."
|
||||
kill -TERM ${pid} >> ${LOG_FILE} 2>&1
|
||||
|
||||
local count=0
|
||||
while check_process "${pid}" && [ $count -lt 10 ]; do
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
log_msg "waiting process terminal... (${count}s/10s)"
|
||||
done
|
||||
|
||||
if check_process "${pid}"; then
|
||||
log_msg "send KILL signal to PID:${pid}..."
|
||||
kill -KILL "${pid}"
|
||||
sleep 1
|
||||
rm -f "${PID_FILE}"
|
||||
else
|
||||
log_msg "process killed... "
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
check_process() {
|
||||
local pid=$1
|
||||
if kill -0 "${pid}" 2>/dev/null; then
|
||||
return 0 # process exist
|
||||
else
|
||||
return 1 # process not exist
|
||||
fi
|
||||
}
|
||||
|
||||
status() {
|
||||
if [ -f "${PID_FILE}" ]; then
|
||||
pid=$(head -n 1 "${PID_FILE}" | tr -d '[:space:]')
|
||||
if check_process "${pid}"; then
|
||||
return 0
|
||||
else
|
||||
# Process is not running but pidfile exists - clean it up
|
||||
rm -f "${PID_FILE}"
|
||||
fi
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
# run start command. exit 0 if success, exit 1 if failed
|
||||
start_process
|
||||
;;
|
||||
stop)
|
||||
# run stop command. exit 0 if success, exit 1 if failed
|
||||
stop_process
|
||||
;;
|
||||
status)
|
||||
# check application status command. exit 0 if running, exit 3 if not running
|
||||
if status; then
|
||||
exit 0
|
||||
else
|
||||
exit 3
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
5
install-package/fpk/fbin/cmd/uninstall_callback
Normal file
5
install-package/fpk/fbin/cmd/uninstall_callback
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called after the user uninstalls the application.
|
||||
|
||||
exit 0
|
||||
5
install-package/fpk/fbin/cmd/uninstall_init
Normal file
5
install-package/fpk/fbin/cmd/uninstall_init
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called after the user uninstalls the application.
|
||||
|
||||
exit 0
|
||||
5
install-package/fpk/fbin/cmd/upgrade_callback
Normal file
5
install-package/fpk/fbin/cmd/upgrade_callback
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called after the user upgrades the application.
|
||||
|
||||
exit 0
|
||||
5
install-package/fpk/fbin/cmd/upgrade_init
Normal file
5
install-package/fpk/fbin/cmd/upgrade_init
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script is called before the user upgrades the application.
|
||||
|
||||
exit 0
|
||||
8
install-package/fpk/fbin/config/privilege
Normal file
8
install-package/fpk/fbin/config/privilege
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"defaults":
|
||||
{
|
||||
"run-as": "root"
|
||||
},
|
||||
"username": "linker-bin",
|
||||
"groupname": "linker-bin"
|
||||
}
|
||||
18
install-package/fpk/fbin/config/resource
Normal file
18
install-package/fpk/fbin/config/resource
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"data-share":
|
||||
{
|
||||
"shares":
|
||||
[
|
||||
{
|
||||
"name": "linker-bin",
|
||||
"permission":
|
||||
{
|
||||
"rw":
|
||||
[
|
||||
"linker-bin"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
15
install-package/fpk/fbin/manifest
Normal file
15
install-package/fpk/fbin/manifest
Normal file
@@ -0,0 +1,15 @@
|
||||
appname = linker
|
||||
version = {version}
|
||||
display_name = Linker
|
||||
desc = 极具特色的,P2P打洞(UDP+TCP、IPV4+IPV6) + 服务器转发,实现的异地组网、内网穿透。让你那些散落在世界各地的联网设备就像在隔壁房间一样轻松访问。
|
||||
arch = x86_64
|
||||
source = thirdparty
|
||||
maintainer=snltty
|
||||
maintainer_url=https://linker.snltty.com
|
||||
distributor=snltty
|
||||
distributor_url=https://linker.snltty.com
|
||||
desktop_uidir=ui
|
||||
desktop_applaunchname=linker.bin.Application
|
||||
|
||||
service_port=1804
|
||||
checkport=true
|
||||
@@ -31,7 +31,7 @@ do
|
||||
|
||||
mkdir -p public/publish-fpk/bin/${r}
|
||||
|
||||
cp -rf install-package/fpk/bin/* public/publish-fpk/bin/${r}/
|
||||
cp -rf install-package/fpk/fbin/* public/publish-fpk/bin/${r}/
|
||||
cp -rf public/publish/${r}/* public/publish-fpk/bin/${r}/app/server/
|
||||
|
||||
sed -i "s|{version}|1.9.7|g" public/publish-fpk/bin/${r}/manifest
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
v1.9.7
|
||||
2025-12-09 11:23:21
|
||||
2025-12-09 11:33:37
|
||||
1. 一些累计更新,一些BUG修复
|
||||
2. 重构中继和穿透的多节点模式
|
||||
3. 中继连接合并到隧道协议中
|
||||
|
||||
@@ -31,7 +31,7 @@ do
|
||||
|
||||
mkdir -p public/publish-fpk/bin/${r}
|
||||
|
||||
cp -rf install-package/fpk/bin/* public/publish-fpk/bin/${r}/
|
||||
cp -rf install-package/fpk/fbin/* public/publish-fpk/bin/${r}/
|
||||
cp -rf public/publish/${r}/* public/publish-fpk/bin/${r}/app/server/
|
||||
|
||||
sed -i "s|{version}|{{version}}|g" public/publish-fpk/bin/${r}/manifest
|
||||
|
||||
Reference in New Issue
Block a user