From a6662268312eb645cc7b5bf9f2ad6f5635d3cb28 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期日, 27 七月 2025 22:47:06 +0800
Subject: [PATCH] add network client and android app

---
 network/android/sening_vdp/setup.sh |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/network/android/sening_vdp/setup.sh b/network/android/sening_vdp/setup.sh
index e69de29..ef6c4c4 100644
--- a/network/android/sening_vdp/setup.sh
+++ b/network/android/sening_vdp/setup.sh
@@ -0,0 +1,42 @@
+#!/data/data/com.termux/files/usr/bin/env bash
+
+pkg install tmux
+
+# 1. get phone number
+phone="$1"
+
+if [[ ! "$phone" =~ ^[0-9]{11}$ ]]; then
+    echo "please input 11 digital phone number"
+    exit 1
+fi
+
+# 2. process toml config file
+name="$phone"
+remotePort="${phone: -4}"
+TOML_FILE="./sening_vdp2.toml"
+
+if [ ! -f "$TOML_FILE" ]; then
+    echo "file sening_vdp2.toml does not exist!"
+    exit 1
+fi
+
+# modify sening_vdp2.toml 's name and remotePort
+sed -i "s/^name *= *.*/name = \"$name\"/" "$TOML_FILE"
+sed -i "s/^remotePort *= *.*/remotePort = $remotePort/" "$TOML_FILE"
+
+echo "鉁� sening_vdp2.toml config already updated."
+
+# 3. create .termux/boot dir
+mkdir -p ~/.termux/boot
+
+# 4. chmod
+chmod +x sening_vdp1 sening_vdp2 start_service.sh
+
+# 5. move start.sh to .termux/boot
+cp start_service.sh ~/.termux/boot/
+chmod +x ~/.termux/boot/start_service.sh
+
+# 6 杩藉姞鍚姩鍛戒护鍒� .bashrc 锛堥伩鍏嶉噸澶嶆坊鍔狅級
+grep -qxF "bash $HOME/start_service.sh" ~/.bashrc || echo "bash $HOME/start_service.sh" >> ~/.bashrc
+
+echo "鉁� setup.sh finished"

--
Gitblit v1.9.1