projects
/
cloudstore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test md5_get on symlinks
[cloudstore.git]
/
remove-user.sh
diff --git
a/remove-user.sh
b/remove-user.sh
index
eedbd36
..
1b683e0
100755
(executable)
--- a/
remove-user.sh
+++ b/
remove-user.sh
@@
-1,10
+1,18
@@
#!/bin/sh -xe
#!/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
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 {} \;