diff options
| author | cassio <cassiopc@gmail.com> | 2013-07-02 05:46:45 +0000 |
|---|---|---|
| committer | cassio <cassiopc@gmail.com> | 2013-07-02 05:46:45 +0000 |
| commit | be2491b093b1f0ca430bede679ecbb670041e483 (patch) | |
| tree | fe2da63d1811cb93e4352a43a113ace37b9f6017 /tools/etc/icpc/doclean.sh | |
| parent | a9aa438ea0558eb0044cf1e54a9190ddb41b65e5 (diff) | |
| download | boca-be2491b093b1f0ca430bede679ecbb670041e483.tar.gz boca-be2491b093b1f0ca430bede679ecbb670041e483.zip | |
restructuring of boca's git
Diffstat (limited to 'tools/etc/icpc/doclean.sh')
| -rwxr-xr-x | tools/etc/icpc/doclean.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/etc/icpc/doclean.sh b/tools/etc/icpc/doclean.sh new file mode 100755 index 0000000..40b49c1 --- /dev/null +++ b/tools/etc/icpc/doclean.sh @@ -0,0 +1,29 @@ +#!/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 | /usr/bin/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 -k /etc/skel -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 +chmod -R u+rwx /home/icpc +fi +cd - >/dev/null +exit 0 |