Files
SIA/scripts/restart.sh
2025-03-03 16:57:04 +01:00

31 lines
778 B
Bash

#!/bin/bash
set -e
echo "=== Preparing SIA environment ==="
echo "Installing ITB tool..."
/root/venvs/itb/bin/pip install -e /root/sia/tools/itb/ || echo "Warning: Failed to install ITB tool"
echo "Installing Train tool..."
/root/venvs/train/bin/pip install -e /root/sia/tools/train/ || echo "Warning: Failed to install Train tool"
echo "Installing SIA core..."
/root/venvs/sia/bin/pip install -e /root/sia/ || { echo "Error: Failed to install SIA core"; exit 1; }
echo "=== Starting SIA ==="
while true; do
sia
EXIT_CODE=$?
if [ $EXIT_CODE -eq 42 ]; then
echo "SIA exited with code 42. Restarting in 2 seconds..."
sleep 2
else
echo "SIA exited with code $EXIT_CODE. Not restarting."
break
fi
done
exit $EXIT_CODE