Skip to content

termux配置

依赖

bash
termux-setup-storage

pkg update
#依赖
#apt install -y openssl1.1-tool openssl-tool libiconv 

#工具
apt install -y screen rsync nginx aria2

#解决 CANNOT LINK EXECUTABLE "screen": library "libcrypto.so.1.1" not found: needed by /data/data/com.termux/files/usr/lib/libcrypt.so in namespace (default)
#cd ~/../usr/lib/openssl-1.1/
#cp libcrypto.so.1.1 ..

配置nginx vi ../usr/etc/nginx/nginx.conf

        location /dl {
            alias  /data/data/com.termux/files/home/dl;
        }
        location /baidu {
            alias  /storage/emulated/0/Download/BaiduNetdisk;
        }
        autoindex on;

配置访问USB外接设备

bash
pkg install termux-api

通过proot安装ubuntu

bash
apt install -y proot proot-distro

export http_proxy=http://127.0.0.1:10809
export https_proxy=http://127.0.0.1:10809

proot-distro install ubuntu
#安装完成后登录到ubuntu
proot-distro login ubuntu

#安装必要的依赖
apt update
apt install sudo screen
#安装sbox
bash <(curl -fsSL https://sing-box.app/deb-install.sh)

mkdir -p /opt/sing-box

配置aria2

bash
#部署aria2ng
cd ~/../usr/share/nginx/html
curl -OJL https://github.com/mayswind/AriaNg-DailyBuild/archive/master.zip
unzip AriaNg-DailyBuild-master.zip
mv AriaNg-DailyBuild-master ang
#aria2配置文件
mkdir ~/aria2 -p
tee ~/aria2/aria2.conf << EOF
dir=$(realpath ~/dl/aria2)
enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true
rpc-listen-port=6800
rpc-secret=humipass
rpc-max-request-size=10M
EOF

下载压缩包完成后自动解压

bash
#!/bin/bash

# 定义要扫描的目录和解压目标目录
SCAN_DIR="/path/to/your/scan_directory"
UNCOMPRESSED_DIR="/path/to/your/uncompressed_directory"

# 确保解压目标目录存在
mkdir -p "$UNCOMPRESSED_DIR"

# 扫描目录中的所有 .zip 文件并解压
find "$SCAN_DIR" -type f -name "*.zip" | while read zip_file; do
    echo "Found zip file: $zip_file"
    
    # 检查是否有密码保护
    if 7z l "$zip_file" | grep -q 'Password:'; then
        echo "Password protected zip file: $zip_file, skipping..."
        # 创建 .fail 文件
        fail_file="${UNCOMPRESSED_DIR}/$(basename "$zip_file").fail"
        touch "$fail_file"
        echo "Created fail file: $fail_file"
    else
        # 解压到目标目录
        7z x "$zip_file" -o"$UNCOMPRESSED_DIR"
    fi
done

echo "All .zip files have been processed."

Last updated: