fix: simplify abra installation service

- Remove retry loop and internet connectivity checks from abra installation service
- Keep working sudo abra --version verification
- Simplify install() function to restart service once instead of 300 times
- Plain installation without overcomplicated logic
This commit is contained in:
2025-09-17 17:24:28 +02:00
parent 5477f97f5d
commit f70ba8ae25

View File

@@ -528,50 +528,36 @@ isoConfig
];
script = ''
# Enhanced installation with proper verification
# Plain abra installation
export TERM=xterm-256color
export HOME=/root
# Check if abra is already properly installed (CORRECTED VERIFICATION)
# Check if abra is already properly installed
if sudo abra --version >/dev/null 2>&1; then
echo " abra already installed and functional"
exit 0
fi
# Attempt installation with retry logic
for attempt in {1..60}; do
echo "🚀 Installing abra (attempt $attempt/60)..."
echo "🚀 Installing abra system-wide..."
# Quick internet check before attempting installation
if ! curl -s --max-time 3 https://abra.coopcloud.tech >/dev/null 2>&1; then
echo "🌐 No internet connectivity, skipping attempt $attempt"
elif curl -fsSL https://install.abra.coopcloud.tech | bash; then
# Verify installation success using CORRECT check method
if sudo abra --version >/dev/null 2>&1; then
echo " abra installed successfully"
# Plain installation
curl -fsSL https://install.abra.coopcloud.tech | bash
# Add to bashrc only once
if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then
echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc
echo " Added /root/.local/bin to PATH in /root/.bashrc"
fi
# Verify installation
if sudo abra --version >/dev/null 2>&1; then
echo " abra installed successfully"
exit 0
else
echo " Installation script completed but abra not functional"
fi
else
echo " Installation attempt $attempt failed"
# Add to bashrc only once
if ! grep -q "/root/.local/bin" /root/.bashrc 2>/dev/null; then
echo 'export PATH="$PATH:/root/.local/bin"' >> /root/.bashrc
echo " Added /root/.local/bin to PATH in /root/.bashrc"
fi
if [ $attempt -lt 60 ]; then
echo " Retrying in 5 seconds..."
sleep 5
fi
done
echo " abra installation failed after 60 attempts"
exit 1
exit 0
else
echo " abra installation failed"
exit 1
fi
'';
serviceConfig = {
@@ -1214,7 +1200,7 @@ isoConfig
install() {
echo "🔄 Checking and repairing abra installation..."
# Use the CORRECT check method (matches service verification)
# Check if abra is already installed
if sudo abra --version >/dev/null 2>&1; then
echo " abra is already installed and functional"
return 0
@@ -1223,18 +1209,17 @@ isoConfig
echo "🔄 Restarting abra installation service..."
sudo systemctl restart workshop-abra-install
# Monitor installation progress
echo "📊 Monitoring installation..."
for i in {1..30}; do
if sudo abra --version >/dev/null 2>&1; then
echo " abra installation completed successfully!"
return 0
fi
sleep 2
done
# Wait for service to complete
sleep 5
echo " Installation still not complete. Check status:"
echo " sudo systemctl status workshop-abra-install"
# Check if installation succeeded
if sudo abra --version >/dev/null 2>&1; then
echo " abra installation completed successfully!"
return 0
else
echo " Installation failed. Try running 'install' again or check status:"
echo " sudo systemctl status workshop-abra-install"
fi
}
recipes() {