listunserv.sh 613 Bytes
Newer Older
Vincent Vanlaer's avatar
Vincent Vanlaer committed
1
2
3
#!/bin/sh
LIST="KULSTUD"
LOGIN_USER="voornaam.achternaam@student.kuleuven.be"
4
5
LOGIN_PASSWORD=""
# Login password can be changed on ls.kuleuven.be
Vincent Vanlaer's avatar
Vincent Vanlaer committed
6
7
REALNAME="Voornaam+Achternaam"

8
9
LOGIN_TOKEN=`curl -d @- -X POST https://ls.kuleuven.be/cgi-bin/wa <<< "LOGIN1=&Y=${LOGIN_USER}&p=${LOGIN_PASSWORD}&e=Log+In&X=" | grep 'X=' | cut -f 5 -d '=' | cut -f 1 -d '"'`

Vincent Vanlaer's avatar
Vincent Vanlaer committed
10
11
12
13
14
for item in $LIST
do
   echo $item
   curl -d @- -X POST https://ls.kuleuven.be/cgi-bin/wa <<< "SUBED2=${item}&X=${LOGIN_TOKEN}&Y=${LOGIN_USER}&_charset_=UTF-8&L=${item}&p=${REALNAME}&q=${REALNAME}&s=${LOGIN_USER}&t=${LOGIN_USER}&0=&1=&2=&3=NOMAIL&4="
done