#/bin/sh
# Simple script to automate login on chalmers nomad network.
# Written by Rickard Gustafsson, 2007-02-20.
# Modyfied by Ola Holmstrom 2007-11 and Sebastian Johansson 2009-01

iwgetid | grep -q NOMAD	#exits with 0 if connected to NOMAD 

if [ $? -eq 0 ]; then	#connected to NOMAD?
	USER="user"	#username without ending /net

	#Specify password in script
	PASS="pass" 	#/net password

	#Give pass in console
	#stty -echo
	#echo -n "CID/net-Password: "
	#read PASS
	#stty echo
	#echo ""

	URL="https://login.nomad.chalmers.se/"
	POST_DATA="action=Login&login=$USER%2Fnet&password=$PASS&org=Radius"
	curl --silent -kd $POST_DATA $URL 2>&1 > /dev/null	#requiers curl
	exit 0
else
	echo "Not connected to NOMAD"
	exit 1
fi

Kategorier: Systemet