X-Git-Url: http://git.hcoop.net/clinton/scripts.git/blobdiff_plain/e14418486bd9af71b4e70c147260d4fed34f2876..4f00b3491030adbecd67e711d0e42d51dffac4c0:/change-user-password diff --git a/change-user-password b/change-user-password index bb5b0c2..f313f8b 100755 --- a/change-user-password +++ b/change-user-password @@ -10,5 +10,12 @@ USER=$1 sudo rm -f /tmp/kadmin.out sudo kadmin.local -p root/admin -q "cpw $USER@HCOOP.NET" \ 2>&1 | tee /tmp/kadmin.out +cat /tmp/kadmin.out | grep '\(is too short while changing\|does not contain enough\)' && \ + (echo == sending complaint to $USER@hcoop.net ====================================================;\ + echo 'please change it' |\ + mail -a 'From: Adam Megacz ' \ + -c admins@hcoop.net \ + -s "your ~/.mire-password is too short or not complex enough" $USER@hcoop.net) || \ + true cat /tmp/kadmin.out | grep '\(Password for .* changed\|Cannot reuse password while changing password\)' sudo rm -f /tmp/kadmin.out