HCoop
/
clinton
/
scripts.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
You need domtool-admin rights to destroy a user
[clinton/scripts.git]
/
change-user-password
diff --git
a/change-user-password
b/change-user-password
index
4a321f2
..
b011c1f
100755
(executable)
--- a/
change-user-password
+++ b/
change-user-password
@@
-1,4
+1,6
@@
-#!/bin/bash -ex
+#!/bin/bash -e
+
+# disable debug !/bin/bash -ex
#
# Finally, set password for main user's principal
# Aborting this operation is harmless. Just re-invoke cpw.
#
# Finally, set password for main user's principal
# Aborting this operation is harmless. Just re-invoke cpw.
@@
-10,12
+12,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
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
' && \
+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' |\
(echo == sending complaint to $USER@hcoop.net ====================================================;\
echo 'please change it' |\
- mail -a 'From:
Adam Megacz <megacz
@hcoop.net>' \
+ mail -a 'From:
HCoop Admins <admins
@hcoop.net>' \
-c admins@hcoop.net \
-c admins@hcoop.net \
- -s "your ~/.mire-password is too short" $USER@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
true
cat /tmp/kadmin.out | grep '\(Password for .* changed\|Cannot reuse password while changing password\)'
sudo rm -f /tmp/kadmin.out