diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-08-06 09:09:10 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-08-06 09:09:10 +0000 |
| commit | 866658cded5b92ddb2681dead1ebaf111d712fcc (patch) | |
| tree | cf7534c4726a142189e096ce82f8d73b2a398ecc /boca-1.5.0/tools/etc/icpc/restart.sh | |
| download | boca-866658cded5b92ddb2681dead1ebaf111d712fcc.tar.gz boca-866658cded5b92ddb2681dead1ebaf111d712fcc.zip | |
init
Diffstat (limited to 'boca-1.5.0/tools/etc/icpc/restart.sh')
| -rwxr-xr-x | boca-1.5.0/tools/etc/icpc/restart.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/boca-1.5.0/tools/etc/icpc/restart.sh b/boca-1.5.0/tools/etc/icpc/restart.sh new file mode 100755 index 0000000..8c6c98c --- /dev/null +++ b/boca-1.5.0/tools/etc/icpc/restart.sh @@ -0,0 +1,31 @@ +#!/bin/bash +uid=`id -u` +if [ "$uid" != "0" ]; then + echo "Must be root to run this script. Use sudo /bin/bash first" + exit 1 +fi + +apt-get clean +if [ -f /etc/icpc/postgresql.version ]; then + . /etc/icpc/postgresql.version +else +POSTGRESV="" +if [ ! -f /etc/init.d/postgresql ]; then + POSTGRESV="-8.4" +fi +fi + +pass=\$`echo -n icpc | makepasswd --clearfrom - --crypt-md5 | cut -d'$' -f2-` +usermod -p "$pass" icpc + +rm -f /etc/icpc/.isserver +rm -f /etc/icpc/.firsttimedone +rm -f /etc/icpc/bocaserver.sh +/etc/icpc/cleandisk.sh +/etc/init.d/apache2 stop +/etc/init.d/postgresql$POSTGRESV stop +rm -f /var/log/apache2/* +rm -f /var/log/postgresql/* +update-rc.d -f apache2 remove +update-rc.d -f postgresql$POSTGRESV remove + |