Re: Automatic website logging to WLAN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> To access some WLAN I have to login on a webpage with certain
> credentials. Until I do that all communication is blocked so e-mail or
> messaging clients can't connect.
> 
> Is there a simple way to send such login request from command line /
> script? It would be ideal if such script was invoked automatically just
> after connection to this network.

I put a crude script in /etc/network/if-up.d for this purpose. I apologize for the mangling Modest is likely to do to the script below, but I hope it helps you begin work on a script suitable to your own needs.

#!/bin/sh
#
# Automatically log into mySSID

set -e

if [ "$IFACE" = lo ]; then
	exit 0
fi

if [ "$MODE" != start ]; then
	exit 0
fi

if [ "$ICD_CONNECTION_TYPE" != WLAN_INFRA ]; then
	exit 0
fi

key="/system/osso/connectivity/IAP/$ICD_CONNECTION_ID/name"
name=$(/usr/bin/gconftool -g "$key")

if [ "$name" != mySSID ]; then
	exit 0
fi

wget --no-check-certificate --quiet -O - \
    --post-data="reqForm=perfigo_login.jsp&uri=&cm=&userip=`ifconfig \
    | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | \
    awk '{ print $1}'`&session=&pm=&index=0&pageid=-1&compact=false&registerGuest=NO&userNameLabel=mySSID%20ID&passwordLabel=Password&guestUserNameLabel=guest&guestPasswordLabel=guest&username=user&password=pass&provider=mySSID" \
    https://wireless-cas.mydomain.com/auth/perfigo_cm_validate.jsp

exit 0

_______________________________________________
maemo-users mailing list
maemo-users@xxxxxxxxx
https://lists.maemo.org/mailman/listinfo/maemo-users


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Big List of Linux Books]    

  Powered by Linux