display and/or create md5sum in user.md5 xattr
[cloudstore.git] / remove-user.sh
index eedbd36..1b683e0 100755 (executable)
@@ -1,10 +1,18 @@
 #!/bin/sh -xe
 
-login=$1
+. ./env.sh
 
-if [ -z "$login" ]; then
-       ls -al users/
+email=$1
+passwd=/var/lib/extrausers/passwd
+
+if [ -z "$email" ]; then
+       cat $passwd | cut -d: -f5
        exit 1
 fi
 
-rm -Rv users/$login
+if dir=`grep ":$email:" $passwd | cut -d: -f6` ; then
+       rm -Rfv $dir
+       grep -v ":$email:" $passwd > $passwd.new && mv $passwd.new $passwd
+fi
+
+find $SLICE/md5/ -links 1 -exec rm -fv {} \;