X-Git-Url: http://git.hcoop.net/clinton/scripts.git/blobdiff_plain/64f69c080c7221b8ab7016a5403c0272510ec6b5..e14418486bd9af71b4e70c147260d4fed34f2876:/change-user-password diff --git a/change-user-password b/change-user-password new file mode 100755 index 0000000..bb5b0c2 --- /dev/null +++ b/change-user-password @@ -0,0 +1,14 @@ +#!/bin/bash -ex +# +# Finally, set password for main user's principal +# Aborting this operation is harmless. Just re-invoke cpw. +# +# kadmin.local doesn't report errors properly, so we have to +# check manually +# +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 '\(Password for .* changed\|Cannot reuse password while changing password\)' +sudo rm -f /tmp/kadmin.out