From 501c55bc0e1d788273876dbb98f6775dbae36fcc Mon Sep 17 00:00:00 2001 From: halliday Date: Sun, 16 Jun 2024 01:04:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 自动更新RDP配置文件/updateRDP.sh | 58 ++++++++++++++++++++++++++++++ 自动更新RDP配置文件/updateRDP.xml | Bin 0 -> 3498 bytes 2 files changed, 58 insertions(+) create mode 100644 自动更新RDP配置文件/updateRDP.sh create mode 100644 自动更新RDP配置文件/updateRDP.xml diff --git a/自动更新RDP配置文件/updateRDP.sh b/自动更新RDP配置文件/updateRDP.sh new file mode 100644 index 0000000..d837dd6 --- /dev/null +++ b/自动更新RDP配置文件/updateRDP.sh @@ -0,0 +1,58 @@ +#!/bin/bash +set -x + +PRG="$0" +while [ -h "$PRG" ]; do + ls=$(ls -ld "$PRG") + link=$(expr "$ls" : '.*-> \(.*\)$') + if expr "$link" : '.*/.*' >/dev/null; then + PRG="$link" + else + PRG=$(dirname "$PRG")/"$link" + fi +done +PRGDIR=$(dirname "$PRG") + +#full path +cd $PRGDIR +ROOT_DIR=$(pwd) +cd - >/dev/null + + +# 生成最新的rbp配置文件 +./RDPWrapOffsetFinder/64bit/RDPWrapOffsetFinder.exe >"$ROOT_DIR"/rdp.ini + +# 和之前的比较 +diff "$ROOT_DIR"/rdp.ini "$ROOT_DIR"/rdpold.ini + +if [ $? -eq 0 ]; then + echo "文件一致无需修改" + exit 0 +fi + +echo "文件不一致,更新配置" + +#组装成完整的文件 +rm -rf "$ROOT_DIR"/rdpwrap.ini +cat "$ROOT_DIR"/rdp-head.ini >"$ROOT_DIR"/rdpwrap.ini +cat "$ROOT_DIR"/rdp.ini >>"$ROOT_DIR"/rdpwrap.ini + +uptime=`date +"%Y-%m-%d"` +sed -i "s/uptime/$uptime/g" "$ROOT_DIR"/rdpwrap.ini +# 处理换行符的问题 +unix2dos "$ROOT_DIR"/rdpwrap.ini + + +#替换之前的配置,并重启服务 +mv "/C/program Files/RDP Wrapper/rdpwrap.ini" "/C/program Files/RDP Wrapper/rdpwrap.ini-bak" + +cp "$ROOT_DIR"/rdpwrap.ini "/C/program Files/RDP Wrapper/rdpwrap.ini" + +net stop TermService //y +sleep 5 +net start TermService + + +# 最后将本次更新的重命名 +mv "$ROOT_DIR"/rdp.ini "$ROOT_DIR"/rdpold.ini + diff --git a/自动更新RDP配置文件/updateRDP.xml b/自动更新RDP配置文件/updateRDP.xml new file mode 100644 index 0000000000000000000000000000000000000000..1adad562048d88f5049eef0925c4ee14df3335be GIT binary patch literal 3498 zcmbW3TT|Oe5QY1BtMVTx-Z28clbfK7EMu#EykN}oAb_Rtk!2d*WlN-Pk0%DkReae$Qdj8 zF265~LQK*P`W@Fvn3tbz{A}=kIm<$y@fI;OZHNDs9l*22R|}1OylvXtUb&j%9@$rX zU*j>Dy)Bg$H4)LAhIdP<_tZXe$&qWq=p2|*}%1WknbwgzaaL8Z~ds)<3 zLwo3Jrd;)MSI?t62T@h&dTeLjr5kk62A$jFzeUb=cn=(DGSUAIOqws;&$jt$r$7lu@OznCW>fmdnf4YSVWK-nD;de=N&F2L6Kc*yZ=m zOgoJD4tQT-o5A1?iFP`5d>53dXC`5-CuB)1eibE-vIBbNoi+yfv9wmY>~k+vPQJ)ZF%8KZFlsa3q2Poz^)_NAP z7cmTb*oB{9Q}*TuX4H+vK66OiVYP?etY;JZ2`fN38`CYyqy%BbzE(7Ty)gDg5uDD zm2NJJ(bcnv`BYD#`X|&0T{q-OU{cLTEQ>uZc1DqrD#|L&81sUB+`^>KdJk4rtYsQ8 z#xXb5gxyg$rEp6tPT*6%wT^S*?BPSF)`{so&P=zgOJ$#8zjnZnYD1-w};g zYliH-M|R1*M|+>%Iyg6*RA!KA)x4ER~_>y_A{BVzH8% Qjr${1S@V6b%PnmG2h*J=W&i*H literal 0 HcmV?d00001