3 # disable debug !/bin/bash -ex
5 # Finally, set password for main user's principal
6 # Aborting this operation is harmless. Just re-invoke cpw.
8 # kadmin.local doesn't report errors properly, so we have to
12 sudo
rm -f /tmp
/kadmin.out
13 sudo kadmin.
local -p root
/admin
-q "cpw $USER@HCOOP.NET" \
14 2>&1 |
tee /tmp
/kadmin.out
15 cat /tmp
/kadmin.out |
grep '\(is too short while changing\|does not contain enough\)' && \
16 (echo == sending complaint to
$USER@hcoop.net
====================================================;\
17 echo 'please change it' |\
18 mail -a 'From: Adam Megacz <megacz@hcoop.net>' \
20 -s "your ~/.mire-password is too short or not complex enough" $USER@hcoop.net
) || \
22 cat /tmp
/kadmin.out |
grep '\(Password for .* changed\|Cannot reuse password while changing password\)'
23 sudo
rm -f /tmp
/kadmin.out