#!/bin/sh # wcrooms - list all rooms with their members # Usage: ./wcrooms [-d db_path] set -eu DB="fanr.sqlite" ULID_LEN=26 while getopts "d:h" opt; do case "$opt" in d) DB="$OPTARG" ;; h) cat < EOF exit 0 ;; *) exit 1 ;; esac done if [ ! -f "$DB" ]; then echo "Error: Database '$DB' not found" >&2 exit 1 fi command -v sqlite3 >/dev/null 2>&1 || { echo "Error: sqlite3 not found" >&2 exit 1 } sqlite3 "$DB" -batch <