23 lines
554 B
Bash
Executable File
23 lines
554 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Define colors
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Check if pdbedit is installed
|
|
if ! command -v pdbedit &> /dev/null; then
|
|
echo -e "${YELLOW}Error:${NC} pdbedit is not installed. Install Samba first."
|
|
exit 1
|
|
fi
|
|
|
|
# Display heading
|
|
echo -e "${GREEN}------------------------${NC}"
|
|
echo -e "${GREEN}Registered Samba users:${NC}"
|
|
echo -e "${GREEN}------------------------${NC}"
|
|
|
|
# List users with color
|
|
pdbedit -L | cut -d: -f1 | while read -r user; do
|
|
echo -e " ${YELLOW}${user}${NC}"
|
|
done
|
|
echo " " |