Skip to content

Commit 07a80c4

Browse files
committed
up:v1.2
1 parent a028c37 commit 07a80c4

File tree

7 files changed

+113
-83
lines changed

7 files changed

+113
-83
lines changed

Changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
KoolCenter RustDesk Server Changelog
22
===========================================
3+
1.3
4+
- add 新增强制使用中继服务器选项
5+
6+
1.2
7+
- fix 插件icon大小的问题
8+
39
1.1
410
- fix 修复无法使用加密连接的问题
511
- add 重新生成加密证书功能

config.json.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
"description": "RustDesk是一款优秀的免费开源的远程控制软件,此插件提供RustDesk自建服务器功能。",
44
"home_url": "Module_rustdesk.asp",
55
"link": "https://github.com/everstu/Koolcenter_rustdesk",
6-
"md5": "9598e0bf7f96e918726a18bbcdfd8615",
6+
"md5": "52a5fc7d286f79c3c13718e4f0e820a5",
77
"module": "rustdesk",
88
"tags": "穿透",
99
"title": "RustDesk Server",
10-
"version": "1.2"
10+
"version": "1.3"
1111
}

rustdesk/install.sh

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,34 @@ alias echo_date='echo 【$(TZ=UTC-8 date -R +%Y年%m月%d日\ %X)】:'
44
MODEL=
55
FW_TYPE_CODE=
66
FW_TYPE_NAME=
7-
DIR=$(cd $(dirname $0); pwd)
7+
DIR=$(
8+
cd $(dirname $0)
9+
pwd
10+
)
811
module=${DIR##*/}
912

10-
get_model(){
13+
get_model() {
1114
local ODMPID=$(nvram get odmpid)
1215
local PRODUCTID=$(nvram get productid)
13-
if [ -n "${ODMPID}" ];then
16+
if [ -n "${ODMPID}" ]; then
1417
MODEL="${ODMPID}"
1518
else
1619
MODEL="${PRODUCTID}"
1720
fi
1821
}
1922

2023
get_fw_type() {
21-
local KS_TAG=$(nvram get extendno|grep -Eo "kool.+")
22-
if [ -d "/koolshare" ];then
23-
if [ -n "${KS_TAG}" ];then
24+
local KS_TAG=$(nvram get extendno | grep -Eo "kool.+")
25+
if [ -d "/koolshare" ]; then
26+
if [ -n "${KS_TAG}" ]; then
2427
FW_TYPE_CODE="2"
2528
FW_TYPE_NAME="${KS_TAG}官改固件"
2629
else
2730
FW_TYPE_CODE="4"
2831
FW_TYPE_NAME="koolshare梅林改版固件"
2932
fi
3033
else
31-
if [ "$(uname -o|grep Merlin)" ];then
34+
if [ "$(uname -o | grep Merlin)" ]; then
3235
FW_TYPE_CODE="3"
3336
FW_TYPE_NAME="梅林原版固件"
3437
else
@@ -38,40 +41,40 @@ get_fw_type() {
3841
fi
3942
}
4043

41-
platform_test(){
42-
local LINUX_VER=$(uname -r|awk -F"." '{print $1$2}')
44+
platform_test() {
45+
local LINUX_VER=$(uname -r | awk -F"." '{print $1$2}')
4346
local ARCH=$(uname -m)
44-
if [ -d "/koolshare" -a -f "/usr/bin/skipd" -a "${LINUX_VER}" -ge "41" ];then
47+
if [ -d "/koolshare" -a -f "/usr/bin/skipd" -a "${LINUX_VER}" -ge "41" ]; then
4548
echo_date 机型:"${MODEL} ${FW_TYPE_NAME} 符合安装要求,开始安装插件!"
4649
else
4750
exit_install 1
4851
fi
4952
}
5053

51-
set_skin(){
54+
set_skin() {
5255
local UI_TYPE=ASUSWRT
5356
local SC_SKIN=$(nvram get sc_skin)
54-
local ROG_FLAG=$(grep -o "680516" /www/form_style.css|head -n1)
55-
local TUF_FLAG=$(grep -o "D0982C" /www/form_style.css|head -n1)
56-
local TS_FLAG=$(grep -o "2ED9C3" /www/css/difference.css 2>/dev/null|head -n1)
57-
if [ -n "${ROG_FLAG}" ];then
57+
local ROG_FLAG=$(grep -o "680516" /www/form_style.css | head -n1)
58+
local TUF_FLAG=$(grep -o "D0982C" /www/form_style.css | head -n1)
59+
local TS_FLAG=$(grep -o "2ED9C3" /www/css/difference.css 2>/dev/null | head -n1)
60+
if [ -n "${ROG_FLAG}" ]; then
5861
UI_TYPE="ROG"
5962
fi
60-
if [ -n "${TUF_FLAG}" ];then
63+
if [ -n "${TUF_FLAG}" ]; then
6164
UI_TYPE="TUF"
6265
fi
63-
if [ -n "${TS_FLAG}" ];then
66+
if [ -n "${TS_FLAG}" ]; then
6467
UI_TYPE="TS"
6568
fi
6669

67-
if [ -z "${SC_SKIN}" -o "${SC_SKIN}" != "${UI_TYPE}" ];then
70+
if [ -z "${SC_SKIN}" -o "${SC_SKIN}" != "${UI_TYPE}" ]; then
6871
echo_date "安装${UI_TYPE}皮肤!"
6972
nvram set sc_skin="${UI_TYPE}"
7073
nvram commit
7174
fi
7275
}
7376

74-
exit_install(){
77+
exit_install() {
7578
local state=$1
7679
case $state in
7780
1)
@@ -81,42 +84,41 @@ exit_install(){
8184
echo_date "退出安装!"
8285
rm -rf /tmp/rustdesk* >/dev/null 2>&1
8386
exit 1
84-
;;
85-
0|*)
87+
;;
88+
0 | *)
8689
rm -rf /tmp/rustdesk* >/dev/null 2>&1
8790
exit 0
88-
;;
91+
;;
8992
esac
9093
}
9194

92-
dbus_nset(){
95+
dbus_nset() {
9396
# set key when value not exist
9497
local ret=$(dbus get $1)
95-
if [ -z "${ret}" ];then
98+
if [ -z "${ret}" ]; then
9699
dbus set $1=$2
97100
fi
98101
}
99102

100-
101103
install_now() {
102104
# default value
103105
local TITLE="RustDesk Server"
104106
local DESCR="RustDesk是一款优秀的免费开源的远程控制软件,此插件提供RustDesk自建服务器功能。"
105107
local PLVER=$(cat ${DIR}/version)
106108

107109
# 生成默认目录
108-
if [ ! -d /koolshare/configs/rustdesk ];then
109-
mkdir -p /koolshare/configs/rustdesk
110+
if [ ! -d /koolshare/configs/rustdesk ]; then
111+
mkdir -p /koolshare/configs/rustdesk
110112
fi
111113

112114
# stop signdog first
113115
local rustEnable=$(dbus get rustdesk_enable)
114-
if [ "${rustEnable}" == "1" ];then
116+
if [ "${rustEnable}" == "1" ]; then
115117
echo_date "先关闭RustDesk插件!以保证更新成功!"
116118
sh /koolshare/scripts/rustdesk_config.sh stop
117119
dbus set rustdesk_enable=1
118120
fi
119-
121+
120122
# remove some files first
121123
find /koolshare/init.d/ -name "*rustdesk*" | xargs rm -rf
122124

@@ -128,7 +130,7 @@ install_now() {
128130
cp -rf /tmp/${module}/webs/* /koolshare/webs/
129131
cp -rf /tmp/${module}/uninstall.sh /koolshare/scripts/uninstall_${module}.sh
130132
mkdir -p /koolshare/configs/rustdesk
131-
133+
132134
#创建开机自启任务
133135
[ ! -L "/koolshare/init.d/S99rustdesk.sh" ] && ln -sf /koolshare/scripts/rustdesk_config.sh /koolshare/init.d/S99rustdesk.sh
134136
[ ! -L "/koolshare/init.d/N99rustdesk.sh" ] && ln -sf /koolshare/scripts/rustdesk_config.sh /koolshare/init.d/N99rustdesk.sh
@@ -149,8 +151,8 @@ install_now() {
149151
dbus set softcenter_module_${module}_description="${DESCR}"
150152

151153
# 获取安装包二进制
152-
local rustdesk_hbbr_version=$(echo $(/koolshare/bin/hbbr --version) |awk '{print $2}');
153-
local rustdesk_hbbs_version=$(echo $(/koolshare/bin/hbbs --version) |awk '{print $2}');
154+
local rustdesk_hbbr_version=$(echo $(/koolshare/bin/hbbr --version) | awk '{print $2}')
155+
local rustdesk_hbbs_version=$(echo $(/koolshare/bin/hbbs --version) | awk '{print $2}')
154156

155157
# 检查插件默认dbus值
156158
dbus_nset rustdesk_hbbs_port "21116"
@@ -162,21 +164,21 @@ install_now() {
162164
# 设置证书信息
163165
rustdesk_key_pub_tmp=$(dbus get rustdesk_key_pub)
164166
rustdesk_key_priv_tmp=$(dbus get rustdesk_key_priv)
165-
/koolshare/bin/rustdesk-utils genkeypair |awk '{print $3}' > /tmp/upload/rustdesk_key_cert.tmp
166-
if [ -z "${rustdesk_key_pub_tmp}" -o -z "${rustdesk_key_priv_tmp}" ];then
167-
rustdesk_key_pub_tmp=$(cat /tmp/upload/rustdesk_key_cert.tmp |awk 'FNR == 1')
168-
rustdesk_key_priv_tmp=$(cat /tmp/upload/rustdesk_key_cert.tmp |awk 'FNR == 2')
167+
/koolshare/bin/rustdesk-utils genkeypair | awk '{print $3}' >/tmp/upload/rustdesk_key_cert.tmp
168+
if [ -z "${rustdesk_key_pub_tmp}" -o -z "${rustdesk_key_priv_tmp}" ]; then
169+
rustdesk_key_pub_tmp=$(cat /tmp/upload/rustdesk_key_cert.tmp | awk 'FNR == 1')
170+
rustdesk_key_priv_tmp=$(cat /tmp/upload/rustdesk_key_cert.tmp | awk 'FNR == 2')
169171
fi
170172
rm -f /tmp/upload/rustdesk_key_cert.tmp >/dev/null 2>&1
171173
# 写入证书
172-
echo -n $rustdesk_key_pub_tmp > /koolshare/configs/rustdesk/id_ed25519.pub
173-
echo -n $rustdesk_key_priv_tmp > /koolshare/configs/rustdesk/id_ed25519
174+
echo -n $rustdesk_key_pub_tmp >/koolshare/configs/rustdesk/id_ed25519.pub
175+
echo -n $rustdesk_key_priv_tmp >/koolshare/configs/rustdesk/id_ed25519
174176
# 设置证书
175177
dbus set rustdesk_key_pub=$rustdesk_key_pub_tmp
176178
dbus set rustdesk_key_priv=$rustdesk_key_priv_tmp
177179

178180
# reenable
179-
if [ "${rustEnable}" == "1" ];then
181+
if [ "${rustEnable}" == "1" ]; then
180182
echo_date "重新启动RustDesk插件!"
181183
sh /koolshare/scripts/rustdesk_config.sh boot_up
182184
fi

0 commit comments

Comments
 (0)