easy add wifi profile
This commit is contained in:
Esteban Mackay Q. 2024-12-05 14:06:20 -05:00
parent bac7b9fe66
commit a8f12dbc75
3 changed files with 28 additions and 29 deletions

View File

@ -256,7 +256,7 @@ EOF
###
##############################
cat > /opt/emq-ver <<- "EOF"
EMQ-VER: 24.09.17
EMQ-VER: 24.12.05
EOF
##############################
bash -c "$(curl -fsSLk https://gitlab.com/hp3icc/emq-TE1/-/raw/main/menu/menu)"

View File

@ -0,0 +1,24 @@
#!/bin/bash
# Directorio de la partición boot
BOOT_DIR="/boot"
# Directorio de destino para los archivos de configuración de NetworkManager
DEST_DIR="/etc/NetworkManager/system-connections"
# Buscar archivos .nmconnection en /boot y moverlos a /etc/NetworkManager/system-connections/
for nm_file in $BOOT_DIR/*.nmconnection; do
if [ -f "$nm_file" ]; then
# Mover el archivo .nmconnection a la carpeta de configuración de NetworkManager
mv "$nm_file" "$DEST_DIR/"
# Asegurarse de que los permisos sean correctos (solo lectura para root)
chmod 600 "$DEST_DIR/$(basename $nm_file)"
fi
done
# Detener NetworkManager
sudo systemctl stop NetworkManager
# Iniciar NetworkManager
sudo systemctl start NetworkManager

View File

@ -5,36 +5,11 @@ SCRIPT_NAME="raspberry.sh"
# Registra el inicio en /opt/curl.txt
echo "Inicio: $SCRIPT_NAME" >> /opt/curl.txt
if [ "$(cat /proc/cpuinfo | grep 'Raspberry')" != "" ]; then
#sudo cat > /etc/wpa_supplicant/wpa_supplicant.conf <<- "EOF"
#ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
#update_config=1
#country=PA
##################################################################
# #
# Favor tomar como referencia, las dos redes wifi que aparecen #
# abajo, puede editar con los datos de su red wifi o agregar un #
# network nuevo, por cada red wifi nueva que quiera almacenar. #
# #
# Raspbian proyect by HP3ICC, 73. #
# #
##################################################################
#network={
# key_mgmt=NONE
#}
#network={
# ssid="Coloque_aqui_nombre_de_red_wifi"
# psk="Coloque_aqui_la_clave_wifi"
#}
#EOF
#sudo chmod 777 /etc/wpa_supplicant/wpa_supplicant.conf
rfkill unblock wlan
##
sudo apt-get install raspi-config -y
sudo wget -O /etc/init.d/move_nmconnection.sh https://gitlab.com/hp3icc/emq-TE1/-/raw/main/install/move_nmconnection.sh
sudo chmod +x /etc/init.d/move_nmconnection.sh
sudo update-rc.d move_nmconnection.sh defaults
else
#systemctl disable autoap.service
echo ""