Ovako, na uniju kada se spojis na WiFi trazi da se loginujes sa svojim username i password. Posto se to poze i sa wget uradit, sa --post-data napisao sam jednu skripticu koja bi to radila za mene. I onda sam potrazio da vidim da li moze da se skripta sama pokrene kada se promjeni status konekcije? Na netu sam nasao da se takve skipte nalaze u
/etc/NetworkManager/dispatcher.d/
te da bi se one same mogle pokrenuti kada se promjeni status konekcije? Medjutim kod mene se nista ne desva? A barem bi trebale neke notifikacije da se pojave?!?!
Da li neko zna kako napravit da se skripta pokrene sama u slucaju konektovanja na wifi mrezu?
Evo moja skripta ispod?
[code]#!/bin/bash
This script checks if you are connected to “tunet” a TU Wien wireless network.
If you are connected it will automatically login you, with your user name and password…
Sends notification to KDE about running the script
kdialog --passivepopup ‘Checking if connected to “tunet”’ 5
sleep 5
Inspects for correct WiFi SSID
AP=$(iwconfig wlan0 | grep ‘ESSID:’ | awk ‘{print $4}’ | sed ‘s/ESSID://g’ | sed ‘s/"//g’)
echo $AP
If connected to “tunet” it will login you and send you a message!
if [ “$AP” == ‘tunet’ ]; then
kdialog --passivepopup ‘Connected to “tunet” - loging in…’ 5
wget -T 15 -t 1 --post-data ‘username=user_name@student.tuwien.ac.at&password=pass_wort&redirect_url=google.com&buttonClicked=4’ https://webauth.demo.tuwien.ac.at/login.html -o /dev/null
sleep 3
kdialog --passivepopup ‘Successfully logged in!’ 5
Aborts if not connected “tu tunet”
else
kdialog --passivepopup ‘Not connected to “tunet” - aborting…’ 5
fi
[/code]