Files
crumbmissions/crumbmission/crumbwifi.sh
Branko May Trinkwald 2915828adf Add complete Crumbforest mission system
- Interactive mission selector with metadata-driven design
- 5 educational missions (basics + advanced)
- AI assistant roles (Deepbit, Bugsy, Schnippsi, Tobi)
- SnakeCam gesture recognition system
- Token tracking utilities
- CLAUDE.md documentation
- .gitignore for logs and secrets
2025-12-21 01:16:48 +01:00

57 lines
1.4 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# crumbwifi.sh Ein kindgerechtes WLAN-Umschalt-Skript für den Crumbforest-Zero
# 🐧✨ Zeigt bekannte Netzwerke, aktuelle IP und ermöglicht neue Verbindungen
CONF="/etc/wpa_supplicant/wpa_supplicant.conf"
INTERFACE="wlan0"
list_networks() {
echo "📡 Bekannte Netzwerke:"
sudo grep 'ssid=' "$CONF" | sed 's/.*ssid=//' | sed 's/"//g' | nl
}
show_current() {
echo "🔎 Aktuell verbunden mit:"
echo "SSID: $(iwgetid -r)"
echo "IP: $(hostname -I)"
}
add_network() {
read -p " Neue SSID: " ssid
read -s -p "🔐 Passwort: " psk
echo
sudo bash -c "wpa_passphrase "$ssid" "$psk" >> $CONF"
echo "$ssid hinzugefügt."
reconnect
}
reconnect() {
echo "🔄 WLAN wird neu gestartet..."
sudo wpa_cli -i "$INTERFACE" reconfigure || echo "⚠️ Reconfigure fehlgeschlagen, versuche Fallback."
sleep 3
echo "🌐 Neue Verbindung aktiv? Prüfe IP: $(hostname -I)"
}
menu() {
while true; do
echo
echo "====== 🌲 Crumbforest WLAN-Menü ======"
echo "1) 📋 Netzwerke anzeigen"
echo "2) 🔄 Aktuelles Netzwerk zeigen"
echo "3) Neues Netzwerk hinzufügen"
echo "4) ❌ Abbrechen"
echo "======================================"
read -p "Wähle eine Option (1-4): " opt
case $opt in
1) list_networks ;;
2) show_current ;;
3) add_network ;;
4) echo "🚪 Tschüss!"; exit 0 ;;
*) echo "Ungültige Eingabe." ;;
esac
done
}
menu