fix: improve abra install retry logic and remove restart loop
This commit is contained in:
19
common.nix
19
common.nix
@@ -519,10 +519,13 @@ isoConfig
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Attempt installation with retry logic
|
# Attempt installation with retry logic
|
||||||
for attempt in {1..300}; do
|
for attempt in {1..60}; do
|
||||||
echo "🚀 Installing abra (attempt $attempt/300)..."
|
echo "🚀 Installing abra (attempt $attempt/60)..."
|
||||||
|
|
||||||
if curl -fsSL https://install.abra.coopcloud.tech | bash; then
|
# 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
|
# Verify installation success using CORRECT check method
|
||||||
if sudo abra --version >/dev/null 2>&1; then
|
if sudo abra --version >/dev/null 2>&1; then
|
||||||
echo "✅ abra installed successfully"
|
echo "✅ abra installed successfully"
|
||||||
@@ -541,13 +544,13 @@ isoConfig
|
|||||||
echo "❌ Installation attempt $attempt failed"
|
echo "❌ Installation attempt $attempt failed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $attempt -lt 300 ]; then
|
if [ $attempt -lt 60 ]; then
|
||||||
echo "⏳ Retrying in 10 seconds..."
|
echo "⏳ Retrying in 5 seconds..."
|
||||||
sleep 10
|
sleep 5
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "❌ abra installation failed after 300 attempts"
|
echo "❌ abra installation failed after 60 attempts"
|
||||||
exit 1
|
exit 1
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@@ -555,8 +558,6 @@ isoConfig
|
|||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = true;
|
RemainAfterExit = true;
|
||||||
User = "root";
|
User = "root";
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = "30s";
|
|
||||||
Environment = [
|
Environment = [
|
||||||
"TERM=xterm-256color"
|
"TERM=xterm-256color"
|
||||||
"HOME=/root"
|
"HOME=/root"
|
||||||
|
|||||||
Reference in New Issue
Block a user