display and/or create md5sum in user.md5 xattr
[cloudstore.git] / remove-user.sh
1 #!/bin/sh -xe
2
3 . ./env.sh
4
5 email=$1
6 passwd=/var/lib/extrausers/passwd
7
8 if [ -z "$email" ]; then
9         cat $passwd | cut -d: -f5
10         exit 1
11 fi
12
13 if dir=`grep ":$email:" $passwd | cut -d: -f6` ; then
14         rm -Rfv $dir
15         grep -v ":$email:" $passwd > $passwd.new && mv $passwd.new $passwd
16 fi
17
18 find $SLICE/md5/ -links 1 -exec rm -fv {} \;