diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-08-31 09:02:27 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-08-31 09:02:27 +0000 |
| commit | 2948fe8d6055f6dfe6289e64bce426b5e0bb552f (patch) | |
| tree | 2cff8a28f2bcf1f21116b952738b5e683e11c193 /boca-1.5.1/tools/etc/icpc/doclean.sh | |
| parent | 37d5a8f2b6ecf585f91c2f7c804145853f0ca1e9 (diff) | |
| download | boca-2948fe8d6055f6dfe6289e64bce426b5e0bb552f.tar.gz boca-2948fe8d6055f6dfe6289e64bce426b5e0bb552f.zip | |
inclusion of dir 1.5.1 for boca
Diffstat (limited to 'boca-1.5.1/tools/etc/icpc/doclean.sh')
| -rwxr-xr-x | boca-1.5.1/tools/etc/icpc/doclean.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/boca-1.5.1/tools/etc/icpc/doclean.sh b/boca-1.5.1/tools/etc/icpc/doclean.sh new file mode 100755 index 0000000..ea7d517 --- /dev/null +++ b/boca-1.5.1/tools/etc/icpc/doclean.sh @@ -0,0 +1,28 @@ +#!/bin/bash +cd /home +if [ -f /home/icpc/.cleandisk.sh ]; then +rm -rf /home/icpc +find /home -user icpc -delete +if [ -x /usr/bin/makepasswd ]; then + pass=`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-` + pass=\$`echo $pass` + id -u icpc >/dev/null 2>/dev/null + if [ $? != 0 ]; then + useradd -d /home/icpc -m -p "$pass" -s /bin/bash -g users icpc + else + usermod -d /home/icpc -p "$pass" -s /bin/bash -g users icpc + fi +fi +for i in media mnt var opt tmp usr; do + find /$i -user icpc -delete +done +if [ ! -d /home/icpc ]; then + rm -rf /home/icpc + rm -rf /home/skel + cp -ar /etc/skel/ /home + mv /home/skel /home/icpc +fi +chown -R icpc.users /home/icpc +fi +cd - >/dev/null +exit 0 |