Skip to content

Reverse Engineering / Authorized Penetration Testing / Security Research Skill Router Pack AI-powered routing + On-demand toolchain bootstrapping + Self-evolving knowledge base Supports Claude Code, Kiro, Cursor, Cline, and other AI coding clients 逆向/渗透/安全技能路由包 - AI 自动路由 + 按需自举工具链 + 自动进化经验库 | 支持 Claude Code / Kiro / Cursor / Cline 等代码 AI 客户端

Shell

fix(case): support network profiles on Bash 3.2

Atirnab478d3dc22aa
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7b9cb6e..f2ce9e1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -114,6 +114,15 @@ jobs:
grep -Eq '^- ready_for_act: true$' "$scratch/project/work/network-default/scope.md"
bash skills/scripts/case-guard.sh --case-root "$scratch/project/work/network-default"
+ bash skills/scripts/case-init.sh \
+ --hint "authorized web review" \
+ --case-name "uppercase-network" \
+ --package-root "$scratch/project" \
+ --auth-granted \
+ --network-profile "AUTHORIZED_TARGET_ONLY" \
+ --target-url "https://example.test/"
+ grep -Eq '^- mode: authorized_target_only$' "$scratch/project/work/uppercase-network/scope.md"
+
bash skills/scripts/case-init.sh \
--hint "pending review" \
--case-name "guard-section" \
diff --git a/skills/scripts/case-init.sh b/skills/scripts/case-init.sh
index 8e8e6e0..c3b4c6c 100755
--- a/skills/scripts/case-init.sh
+++ b/skills/scripts/case-init.sh
@@ -94,7 +94,8 @@ if [[ -z "$CASE_NAME" || "$case_name_length" -gt 80 ||
exit 2
fi
if [[ -n "$NETWORK_PROFILE" ]]; then
- case "${NETWORK_PROFILE,,}" in
+ network_profile_normalized="$(printf '%s' "$NETWORK_PROFILE" | tr '[:upper:]' '[:lower:]')"
+ case "$network_profile_normalized" in
offline|lab_only|authorized_target_only|unrestricted_lab|lab|authorized|auth|offline_only) ;;
*)
echo "Invalid --network-profile '$NETWORK_PROFILE'. Allowed: offline, lab_only, authorized_target_only, unrestricted_lab (aliases: lab, authorized, auth, offline_only)." >&2
@@ -146,11 +147,12 @@ elif [[ "$auth_status_resolved" == "granted" && ${#ASSETS[@]} -gt 0 && -z "$SAMP
else
network_mode="offline"
fi
-case "${network_mode,,}" in
+network_mode="$(printf '%s' "$network_mode" | tr '[:upper:]' '[:lower:]')"
+case "$network_mode" in
lab) network_mode="lab_only" ;;
authorized|auth) network_mode="authorized_target_only" ;;
offline_only) network_mode="offline" ;;
- offline|lab_only|authorized_target_only|unrestricted_lab) network_mode="${network_mode,,}" ;;
+ offline|lab_only|authorized_target_only|unrestricted_lab) ;;
*)
echo "Invalid --network-profile '$network_mode'. Allowed: offline, lab_only, authorized_target_only, unrestricted_lab (aliases: lab, authorized, auth, offline_only)." >&2
exit 2