Files
proxmox/scripts/archive/small-scripts/add-vlan11-ip-to-bashrc.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

46 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -euo pipefail
# Load IP configuration
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
# Add VLAN 11 IP configuration to ~/.bashrc for WSL2 auto-configuration
# This runs the IP configuration command on each login
set -e
VLAN11_IP="192.168.11.23"
PRIMARY_IF="eth0"
BASHRC="$HOME/.bashrc"
echo "🔧 Adding VLAN 11 IP Auto-Configuration to ~/.bashrc"
echo ""
# Check if already added
if grep -q "add-vlan11-ip" "$BASHRC" 2>/dev/null; then
echo "✅ VLAN 11 IP configuration already in ~/.bashrc"
exit 0
fi
# Add configuration
cat >> "$BASHRC" << 'EOFBASHRC'
# Auto-configure VLAN 11 secondary IP (added automatically)
if [ -n "$(ip link show eth0 2>/dev/null)" ] && ! ip addr show eth0 | grep -q "192.168.11.23"; then
sudo ip addr add 192.168.11.23/24 dev eth0 2>/dev/null || true
sudo ip route add ${NETWORK_192_168_11_0:-192.168.11.0}/24 dev eth0 src 192.168.11.23 2>/dev/null || true
fi
EOFBASHRC
echo "✅ Configuration added to ~/.bashrc"
echo ""
echo "💡 VLAN 11 IP will be added automatically on each login"
echo " (Requires sudo password on first command after login)"
echo ""
echo "📋 To test immediately, run:"
echo " source ~/.bashrc"
echo ""