feat(deployment): replace monster scripts with modular helper scripts (#87)
- Add install.sh orchestrator with upgrade support - Add 6 helper scripts (<100 lines each) replacing 700-800 line monsters - Add deployment/linux/furt.service systemd template - Support both fresh install and upgrade modes - Platform-aware detection (OpenBSD/FreeBSD vs Linux) - Skip user/service creation in upgrade mode - Preserve existing configuration during updates - Remove merkwerk dependency from production install script Helper scripts: - scripts/setup-user.sh - Create system user (_furt/furt) - scripts/setup-directories.sh - Create directory structure - scripts/sync-files.sh - Copy source files to installation - scripts/create-service.sh - Create system service from templates - scripts/validate-config.sh - Validate furt.conf syntax - scripts/health-check.sh - Basic health check functionality Closes DAW/furt#87
This commit is contained in:
parent
8ad77860d1
commit
38a1108a46
8 changed files with 353 additions and 0 deletions
41
scripts/create-service.sh
Executable file
41
scripts/create-service.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/sh
|
||||
# scripts/create-service.sh - Create system service for furt using repository templates
|
||||
|
||||
set -e
|
||||
|
||||
# Check if we're in furt source directory
|
||||
if [ ! -d "deployment" ]; then
|
||||
echo "Error: deployment/ directory not found - not in furt source directory?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(uname)" = "OpenBSD" ]; then
|
||||
# Use OpenBSD rc.d template from repository
|
||||
if [ ! -f "deployment/openbsd/rc.d-furt" ]; then
|
||||
echo "Error: deployment/openbsd/rc.d-furt template not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp deployment/openbsd/rc.d-furt /etc/rc.d/furt
|
||||
chmod +x /etc/rc.d/furt
|
||||
echo "furt_flags=" >> /etc/rc.conf.local
|
||||
rcctl enable furt
|
||||
echo "OpenBSD service created and enabled using repository template"
|
||||
|
||||
elif [ "$(uname)" = "Linux" ]; then
|
||||
# Use systemd template from repository
|
||||
if [ ! -f "deployment/linux/furt.service" ]; then
|
||||
echo "Error: deployment/linux/furt.service template not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp deployment/linux/furt.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable furt
|
||||
echo "Linux systemd service created and enabled using repository template"
|
||||
|
||||
else
|
||||
echo "Unsupported operating system for service creation"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue