From ba80ee22612aca369eba1512d80a2b098811096b Mon Sep 17 00:00:00 2001 From: fumiama Date: Thu, 1 Jul 2021 00:42:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0=E5=B0=8F?= =?UTF-8?q?=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMakeLists.txt | 3 ++- README.md | 7 +++++++ uploader/.gitignore | 3 +++ uploader/push_dmzj.sh | 24 ++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 uploader/.gitignore create mode 100755 uploader/push_dmzj.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index e338208..e56f5a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,4 +21,5 @@ target_link_libraries(simple-kanban spb pthread) target_link_libraries(simple-kanban-client pthread) target_link_libraries(cfgwriter spb) -INSTALL(TARGETS simple-kanban RUNTIME DESTINATION bin) \ No newline at end of file +INSTALL(TARGETS simple-kanban RUNTIME DESTINATION bin) +INSTALL(TARGETS simple-kanban-client RUNTIME DESTINATION bin) \ No newline at end of file diff --git a/README.md b/README.md index fe60218..84c6c12 100644 --- a/README.md +++ b/README.md @@ -106,3 +106,10 @@ simple-kanban [-d] 7777 1 ./kanban.txt ./data.bin ./cfg.sp 键入:quit 回车即可 + +# 上传小工具 +在`uploader`文件夹有一个上传小工具,用法如下 + +```bash +./push_dmzj.sh ip port kanban.txt data.bin password setpass +``` \ No newline at end of file diff --git a/uploader/.gitignore b/uploader/.gitignore new file mode 100644 index 0000000..aa6d268 --- /dev/null +++ b/uploader/.gitignore @@ -0,0 +1,3 @@ +*.bin +*.txt +*.apk \ No newline at end of file diff --git a/uploader/push_dmzj.sh b/uploader/push_dmzj.sh new file mode 100755 index 0000000..883022b --- /dev/null +++ b/uploader/push_dmzj.sh @@ -0,0 +1,24 @@ +if [ $# -lt 6 ]; +then + echo "usage: ip port kanban.txt data.bin password setpass" + exit +fi + +kanban=`sed '/md5:/d' $3` +md5val=`md5 $4` +cat > $3 << EOF +$kanban +EOF +echo md5:${md5val##* } | tr -d '\n' >> $3 +cat > cmd_seq.txt << EOF +fumiamaset$6 +dat +file +$4 +set$6 +ver +file +$3 +quit +EOF +simple-kanban-client $1 $2 < cmd_seq.txt \ No newline at end of file