Linux

Freewifi Network Manager

$ cat /etc/NetworkManager/dispatcher.d/20freewifi_connect

 #!/bin/bash

 USER_LOGIN=ZZZZZZZ
 FREEWIFI_ID=YYYYYYYY
 FREEWIFI_PASSWORD=XXXXXX

 export DISPLAY=:0
 export XAUTHORITY=/home/$USER_LOGIN/.Xauthority

 if [ "$1 $2" = 'wlan0 up' ]
 then
     #essid=$(iwconfig wlan0 | grep -o 'ESSID:".*$' | sed 's/^ESSID:"\(.*\)".*$/\1/') #si iwgetid non dispo utiliser cette methode pour recup l'essid
     essid=$(iwgetid -s)
     case "$essid" in
         'FreeWifi')
             wget -qO- https://wifi.free.fr/Auth --post-data="login=$FREEWIFI_ID&password=$FREEWIFI_PASSWORD"
         /bin/su $USER_LOGIN -c "/usr/bin/notify-send -u low -t 5000 'Auto login' 'Freewifi' -i network-wireless"
         ;;

     esac
 fi