novel-doomsday-resurgence/skills/workspace-netdrive/scripts/detect_mounts.sh
唐天洛 cb9b16e5a8 初始提交:番茄小说创作工作区
包含:
- 核心配置文件(AGENTS.md, SOUL.md, USER.md等)
- 记忆系统(memory/文件夹)
- 技能库(skills/文件夹)
- 小说内容(novel/文件夹)
- .gitignore配置
2026-03-30 15:46:26 +08:00

35 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
MOUNT_ROOT="/root/.openclaw/workspace"
# Check if root directory exists
if [ ! -d "$MOUNT_ROOT" ]; then
echo "No workspace mount root found at $MOUNT_ROOT"
echo "Please configure a network drive (configure TOS bucket information) via the arkClaw interface menu bar."
exit 0
fi
# Detect mounts using df and grep as requested
# We use grep to filter lines containing the mount root
mounts=$(df -P | grep "$MOUNT_ROOT")
if [ -z "$mounts" ]; then
echo "No network drives mounted in workspace."
echo "Please configure a network drive (configure TOS bucket information) via the arkClaw interface menu bar."
exit 0
fi
echo "Detected network drives (Buckets):"
echo "$mounts" | while read -r line; do
# Extract the mount point path.
# df -P ensures POSIX output (no line wrapping), mount point is the last field.
mount_point=$(echo "$line" | awk '{print $NF}')
# Verify it is indeed under our root (double check)
if [[ "$mount_point" == "$MOUNT_ROOT"* ]]; then
# Extract bucket name (last component of path)
bucket_name=$(basename "$mount_point")
echo "Bucket: $bucket_name (Path: $mount_point)"
fi
done