furt/scripts/setup-directories.sh

33 lines
790 B
Bash
Raw Normal View History

#!/bin/sh
# scripts/setup-directories.sh - Create directory structure for furt
set -e
# Detect operating system for config directory
if [ "$(uname)" = "OpenBSD" ] || [ "$(uname)" = "FreeBSD" ]; then
CONFIG_DIR="/usr/local/etc/furt"
USER="_furt"
GROUP="_furt"
else
CONFIG_DIR="/etc/furt"
USER="furt"
GROUP="furt"
fi
# Create directories
mkdir -p "$CONFIG_DIR"
mkdir -p /usr/local/share/furt
mkdir -p /var/log/furt
mkdir -p /var/run/furt
# Set ownership for log directory (service user needs write access)
chown "$USER:$GROUP" /var/log/furt
chown "$USER:$GROUP" /var/run/furt
echo "Created directories:"
echo " Config: $CONFIG_DIR"
echo " Share: /usr/local/share/furt"
echo " Logs: /var/log/furt (owned by $USER)"
echo " PID: /var/run/furt (owned by $USER)"