48 lines
1.2 KiB
Bash
Executable File
48 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Setup script for GOAP Autonomy System
|
|
|
|
set -e
|
|
|
|
echo "=== GOAP Autonomy System Setup ==="
|
|
|
|
# Check if running as root
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit 1
|
|
fi
|
|
|
|
# Create directories
|
|
echo "Creating directories..."
|
|
mkdir -p /root/allegro/goap
|
|
mkdir -p /root/allegro/goap/logs
|
|
mkdir -p /root/backups
|
|
mkdir -p /root/allegro/research
|
|
|
|
# Install Python dependencies
|
|
echo "Installing Python dependencies..."
|
|
pip3 install -q asyncio 2>/dev/null || true
|
|
|
|
# Create __init__.py files if they don't exist
|
|
touch /root/allegro/goap/__init__.py
|
|
|
|
# Set permissions
|
|
chmod +x /root/allegro/goap/*.py
|
|
|
|
# Install systemd service
|
|
echo "Installing systemd service..."
|
|
cp /root/allegro/goap/goap-autonomy.service /etc/systemd/system/
|
|
systemctl daemon-reload
|
|
|
|
echo "=== Setup Complete ==="
|
|
echo ""
|
|
echo "Usage:"
|
|
echo " Start: systemctl start goap-autonomy"
|
|
echo " Stop: systemctl stop goap-autonomy"
|
|
echo " Status: systemctl status goap-autonomy"
|
|
echo " Enable: systemctl enable goap-autonomy"
|
|
echo " Logs: journalctl -u goap-autonomy -f"
|
|
echo ""
|
|
echo "Manual testing:"
|
|
echo " cd /root/allegro/goap && python3 self_goap.py --status"
|
|
echo " cd /root/allegro/goap && python3 self_goap.py --once"
|