Files
proxmox/scripts/archive/consolidated/fix/fix-redis-and-start.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

63 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
# Fix Redis configuration and start services
set -uo pipefail
NODE_IP="${PROXMOX_HOST_R630_01}"
log_info() { echo -e "\033[0;32m[INFO]\033[0m $1"; }
log_success() { echo -e "\033[0;32m[✓]\033[0m $1"; }
log_error() { echo -e "\033[0;31m[ERROR]\033[0m $1"; }
fix_and_start_redis() {
local vmid="$1"
log_info "Fixing and starting Redis on CT $vmid..."
ssh -o ConnectTimeout=15 -o StrictHostKeyChecking=no root@${NODE_IP} "
pct stop $vmid 2>/dev/null || true
sleep 2
pct mount $vmid >/dev/null 2>&1
MOUNT=\$(pct mountpoint $vmid 2>/dev/null || echo '/var/lib/lxc/$vmid/rootfs')
if [ -d \"\$MOUNT\" ]; then
chroot \$MOUNT bash -c '
# Fix Redis config
sed -i \"s/^bind .*/bind 0.0.0.0/\" /etc/redis/redis.conf 2>/dev/null || true
sed -i \"s/^protected-mode yes/protected-mode no/\" /etc/redis/redis.conf 2>/dev/null || true
sed -i \"s/^# maxmemory-policy/maxmemory-policy noeviction/\" /etc/redis/redis.conf 2>/dev/null || true
# Fix permissions
chmod 644 /etc/redis/redis.conf
chown root:root /etc/redis/redis.conf
echo \"Redis config updated\"
'
pct unmount $vmid
fi
pct start $vmid
sleep 5
# Start Redis
pct exec $vmid -- systemctl start redis-server
sleep 3
pct exec $vmid -- systemctl is-active redis-server && echo 'Redis started' || echo 'Redis failed'
" && log_success "Redis started on CT $vmid" || log_error "Failed on CT $vmid"
}
echo "Fixing and starting Redis..."
for vmid in 10020 10120; do
fix_and_start_redis "$vmid"
sleep 3
done
echo ""
log_info "Redis Status:"
for vmid in 10020 10120; do
status=$(ssh -o ConnectTimeout=5 -o StrictHostKeyChecking=no root@${NODE_IP} \
"pct exec $vmid -- systemctl is-active redis-server 2>&1 || echo 'inactive'")
echo " CT $vmid: $status"
done
echo ""
log_success "Redis configuration complete!"