summaryrefslogblamecommitdiffstats
path: root/skripti/spremeni_geslo_ul.sh
blob: acd5c8c84aac9b50411fe80ad57b4c442d503ad6 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

           


                                                         
                                 
          


                                                                                                                                                      
                                                                                                                                                                                                                                                                    
#!/bin/bash
set -xe
read -p "uporabniško ime (jn1234@student.uni-lj.si): " u
read -p "trenutno geslo: " s
read -p "novo geslo: " n
p=`rev <<<$0 | cut -d/ -f1 | rev`
umask 0077
t=`mktemp -p "" $p.XXX`
trap "rm $t" EXIT
r=`curl --cookie $t --cookie-jar $t https://id.uni-lj.si/DigitalnaIdentiteta/SpremembaGesla | grep RequestVerificationToken | tail -n1 | cut -d\" -f6`
curl --cookie $t --cookie-jar $t 'https://id.uni-lj.si/DigitalnaIdentiteta/SpremembaGesla' -X POST --data-raw "Form.Username=$u&Form.Password=$s&Form.NewPassword=$n&Form.NewPasswordConfirmation=$n&__RequestVerificationToken=$r" | grep "Uspešno ste spremenili"