diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2023-09-25 22:40:55 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2023-09-25 22:40:55 +0200 |
commit | 9dd16c5441808b829a4775ed71b308a1bc474e9f (patch) | |
tree | ef78585fc0e29d8a2789ac991d82e135dda7d57a /skripti/ponastavi_geslo_ul.sh | |
parent | umask (diff) | |
download | r-9dd16c5441808b829a4775ed71b308a1bc474e9f.tar r-9dd16c5441808b829a4775ed71b308a1bc474e9f.tar.gz r-9dd16c5441808b829a4775ed71b308a1bc474e9f.tar.bz2 r-9dd16c5441808b829a4775ed71b308a1bc474e9f.tar.lz r-9dd16c5441808b829a4775ed71b308a1bc474e9f.tar.xz r-9dd16c5441808b829a4775ed71b308a1bc474e9f.tar.zst r-9dd16c5441808b829a4775ed71b308a1bc474e9f.zip |
Diffstat (limited to 'skripti/ponastavi_geslo_ul.sh')
-rwxr-xr-x | skripti/ponastavi_geslo_ul.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/skripti/ponastavi_geslo_ul.sh b/skripti/ponastavi_geslo_ul.sh new file mode 100755 index 0000000..4110611 --- /dev/null +++ b/skripti/ponastavi_geslo_ul.sh @@ -0,0 +1,15 @@ +#!/bin/bash +set -xe +read -p "uporabniško ime (jn1234@student.uni-lj.si): " u +read -p "ime: " i +read -p "priimek: " priimek +read -p "datum rojstva (05. 07. 2023): " d +read -p "vpisna številka (12345678): " v +read -p "kratica članice (Agrft/Aluo/Bf/Ef/Fa/... prva črka velika): " k +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/PonastavitevGesla | grep RequestVerificationToken | tail -n1 | cut -d\" -f6` +pipefail=$(curl --cookie $t --cookie-jar $t 'https://id.uni-lj.si/DigitalnaIdentiteta/PonastavitevGesla' -X POST --data-raw "Form.Ime=$i&Form.Priimek=$priimek&Form.DatumRojstva=$d&Form.VpisnaStevilka=$v&Form.OrganizacijaId=$k&Form.Username=$u&__RequestVerificationToken=$r" | grep "novo geslo je") +sed -e 's/.*monospace.>\(.*\)<.strong.*/\1/' <<<"$pipefail" |