X-Git-Url: https://piware.de/gitweb/?a=blobdiff_plain;f=cleanpg;h=e238f183d968301b268c51e5aa3aa6919edcae0b;hb=73f39f614bd2ef7c96785b37b75c3e9a5ae15c21;hp=725713608f4d890953e49c9805de230e82651739;hpb=c262576eb63fd1932151d677fbfb8da43cb81ede;p=bin.git diff --git a/cleanpg b/cleanpg index 7257136..e238f18 100755 --- a/cleanpg +++ b/cleanpg @@ -1,6 +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 killall pg_autovacuum postmaster -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/*