Files
networkofoutside/transform_Indescribable.sh
2026-05-23 15:22:04 +08:00

18 lines
429 B
Bash

#!/bin/bash
FILE="$(pwd)/Indescribable"
if [[ ! -f "$FILE" ]]; then
echo "错误: 文件 '$FILE' 不存在" >&2
exit 1
fi
# 1. 解码 base64
# 2. 仅对 tuic 开头的行替换第一个 %3A 为 :
# 3. 重新 base64 编码(单行,-w 0)
base64 -d "$FILE" \
| sed '/^tuic/s/%3A/:/' \
| base64 -w 0 > "${FILE}.tmp" \
&& mv "${FILE}.tmp" "$FILE"
echo "[成功] 文件 '$FILE' 已成功转换并保存。"