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