X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;f=cleanpg;h=e238f183d968301b268c51e5aa3aa6919edcae0b;hb=2cb5f8d25e41e881bd5f89b1a31b1f06460f1d6c;hp=49392370d52ea696a0d11bff791afd90d9836d14;hpb=86e4de36d9f8d7c4b73cc1b9e5f50504c4ad9bae;p=bin.git diff --git a/cleanpg b/cleanpg index 4939237..e238f18 100755 --- a/cleanpg +++ b/cleanpg @@ -1,8 +1,8 @@ #!/bin/sh -sudo /etc/init.d/postgresql-7.4 stop -sudo /etc/init.d/postgresql-8.0 stop -sudo /etc/init.d/postgresql-8.1 stop -sudo /etc/init.d/postgresql-8.2 stop -sudo /etc/init.d/postgresql-8.3 stop -sudo killall pg_autovacuum postmaster postgres -sudo rm -rf /etc/postgresql /var/lib/postgresql/ /var/log/postgresql/ /tmp/postgresql-testsuite/ /var/run/postgresql/* +[ `id -u` = 0 ] || SUDO=sudo +for v in 7.4 8.0 8.1 8.2 8.3; do + i=/etc/init.d/postgresql-$v + [ -x $i ] && $SUDO $i stop +done +$SUDO killall pg_autovacuum postmaster postgres +$SUDO rm -rf /etc/postgresql /var/lib/postgresql/ /var/log/postgresql/ /tmp/postgresql-testsuite/ /var/run/postgresql/*