Amélioration récap installation: IMSI, lien cliquable, suppression eth0

- Capture l'IMSI dans une variable pour l'afficher dans le récap
- Affiche l'URL complète http://<ip>/html/admin.html (cliquable dans le terminal)
- Supprime la ligne eth0 (pas de connexion ethernet)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
PaulVua
2026-03-10 11:42:46 +01:00
parent bc2aec7946
commit 7c30ccd8f7

View File

@@ -63,7 +63,10 @@ sleep 1
#get SIM card IMSI
info "Get SIM card IMSI"
/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CIMI 2 || warning "SARA IMSI read failed. Continuing..."
imsi_output=$(/usr/bin/python3 /var/www/nebuleair_pro_4g/SARA/sara.py ttyAMA2 AT+CIMI 2 2>&1) || warning "SARA IMSI read failed. Continuing..."
echo "$imsi_output"
# Extract IMSI (15-digit numeric string)
imsi_number=$(echo "$imsi_output" | grep -oP '^\d{15}$' || echo "N/A")
#Connect to network
#info "Connect SARA R4 to network"
@@ -131,11 +134,17 @@ echo "=========================================="
serial_number=$(cat /proc/cpuinfo | grep Serial | awk '{print substr($3, length($3) - 7)}' | tr '[:lower:]' '[:upper:]')
echo -e "${BLUE}Device ID (Serial):${NC} $serial_number"
# Get IP addresses
ip_wlan0=$(ip -4 addr show wlan0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' || echo "Not connected")
ip_eth0=$(ip -4 addr show eth0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' || echo "Not connected")
# Display IMSI
echo -e "${BLUE}IMSI:${NC} ${imsi_number:-N/A}"
echo -e "${BLUE}IP Address (wlan0):${NC} $ip_wlan0"
echo -e "${BLUE}IP Address (eth0):${NC} $ip_eth0"
# Get IP address and make it a clickable link
ip_wlan0=$(ip -4 addr show wlan0 2>/dev/null | grep -oP '(?<=inet\s)\d+(\.\d+){3}' || echo "Not connected")
if [[ "$ip_wlan0" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
admin_url="http://${ip_wlan0}/html/admin.html"
echo -e "${BLUE}IP Address (wlan0):${NC} ${admin_url}"
else
echo -e "${BLUE}IP Address (wlan0):${NC} $ip_wlan0"
fi
echo "=========================================="