Update wifi-sncf-tgv.sh

This commit is contained in:
sacha 2024-04-01 17:54:41 +02:00
parent 402671e69a
commit e9452b5695

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
### Wifi @ SNCF TGV INOUI ### Wifi @ SNCF TGV INOUI
### Sacha 20240401 ### Sacha 20240401
### Validate captive portal access ### Validate captive portal access
wifiinterface="wlp170s0" wifiinterface="wlp170s0"
@ -11,7 +11,7 @@ tmpfile=/tmp/wifi-tgv.tmp
nmap --script broadcast-dhcp-discover -e $wifiinterface > $tmpfile nmap --script broadcast-dhcp-discover -e $wifiinterface > $tmpfile
DNS=$(grep "Domain Name Server" $tmpfile | awk -F: '{gsub (" ", "", $0); print $2}') DNS=$(grep "Domain Name Server" $tmpfile | awk -F: '{gsub (" ", "", $0); print $2}')
# Enabling the wifi # Enabling the wifi
echo "Enabling SNCF's Wifi" echo "Enabling SNCF's Wifi"
curl --silent --output /dev/null -X POST 'https://wifi.sncf/router/api/connection/activate/auto' --resolve wifi.sncf:443:$DNS curl --silent --output /dev/null -X POST 'https://wifi.sncf/router/api/connection/activate/auto' --resolve wifi.sncf:443:$DNS