From 866658cded5b92ddb2681dead1ebaf111d712fcc Mon Sep 17 00:00:00 2001 From: cassiopc Date: Mon, 6 Aug 2012 11:09:10 +0200 Subject: init --- boca-1.5.0/tools/etc/icpc/doclean.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 boca-1.5.0/tools/etc/icpc/doclean.sh (limited to 'boca-1.5.0/tools/etc/icpc/doclean.sh') diff --git a/boca-1.5.0/tools/etc/icpc/doclean.sh b/boca-1.5.0/tools/etc/icpc/doclean.sh new file mode 100755 index 0000000..ea7d517 --- /dev/null +++ b/boca-1.5.0/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 -- cgit v1.2.3