forked from finn/tinyboard
syncthing.sh: List available folders when on Add a folder
This commit is contained in:
@@ -222,6 +222,13 @@ else:
|
||||
|
||||
add_folder() {
|
||||
header "Add Folder"
|
||||
local container
|
||||
container=$(docker ps --format '{{.Names}}' | grep -i syncthing | head -1 || true)
|
||||
if [ -n "$container" ]; then
|
||||
echo "Available folders in /var/syncthing/data/:"
|
||||
docker exec "$container" ls /var/syncthing/data/ 2>/dev/null | sed 's/^/ /' || warn "Could not list data directory."
|
||||
echo ""
|
||||
fi
|
||||
read -rp "Folder path on this device (e.g. /var/syncthing/data/books): " FOLDER_PATH
|
||||
[ -n "$FOLDER_PATH" ] || die "Path cannot be empty."
|
||||
read -rp "Folder label (human-readable name): " FOLDER_LABEL
|
||||
|
||||
Reference in New Issue
Block a user