diff options
| author | Marc G. Fournier | 1996-07-09 06:22:35 +0000 |
|---|---|---|
| committer | Marc G. Fournier | 1996-07-09 06:22:35 +0000 |
| commit | d31084e9d1118b25fd16580d9d8c2924b5740dff (patch) | |
| tree | 3179e66307d54df9c7b966543550e601eb55e668 /src/bin/cleardbdir | |
Postgres95 1.01 Distribution - Virgin SourcesPG95-1_01
Diffstat (limited to 'src/bin/cleardbdir')
| -rw-r--r-- | src/bin/cleardbdir/Makefile | 21 | ||||
| -rw-r--r-- | src/bin/cleardbdir/cleardbdir.sh | 37 |
2 files changed, 58 insertions, 0 deletions
diff --git a/src/bin/cleardbdir/Makefile b/src/bin/cleardbdir/Makefile new file mode 100644 index 00000000000..43d78487c42 --- /dev/null +++ b/src/bin/cleardbdir/Makefile @@ -0,0 +1,21 @@ +#------------------------------------------------------------------------- +# +# Makefile.inc-- +# Makefile for bin/cleardbdir +# +# Copyright (c) 1994, Regents of the University of California +# +# +# IDENTIFICATION +# $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/Makefile,v 1.1.1.1 1996/07/09 06:22:11 scrappy Exp $ +# +#------------------------------------------------------------------------- + +SHPROG= cleardbdir + +MKDIR= ../../mk +include $(MKDIR)/postgres.mk +include ../Makefile.global + +include $(MKDIR)/postgres.shell.mk + diff --git a/src/bin/cleardbdir/cleardbdir.sh b/src/bin/cleardbdir/cleardbdir.sh new file mode 100644 index 00000000000..d9c03ab75cb --- /dev/null +++ b/src/bin/cleardbdir/cleardbdir.sh @@ -0,0 +1,37 @@ +#!/bin/sh +#------------------------------------------------------------------------- +# +# cleardbdir.sh-- +# completely clear out the database directory +# +# this program clears out the database directory, but leaves the .bki +# files so that initdb(1) can be run again. +# +# +# Copyright (c) 1994, Regents of the University of California +# +# +# IDENTIFICATION +# $Header: /cvsroot/pgsql/src/bin/cleardbdir/Attic/cleardbdir.sh,v 1.1.1.1 1996/07/09 06:22:11 scrappy Exp $ +# +#------------------------------------------------------------------------- + +[ -z "$PGDATA" ] && PGDATA=_fUnKy_DATADIR_sTuFf_ + +echo "This program completely destroys all the databases in the directory" +echo "$PGDATA" +echo _fUnKy_DASH_N_sTuFf_ "Are you sure you want to do this (y/n) [n]? "_fUnKy_BACKSLASH_C_sTuFf_ +read resp || exit +case $resp in + y*) : ;; + *) exit ;; +esac + +cd $PGDATA || exit +for i in * +do +if [ $i != "files" -a $i != "pg_hba" ] +then + /bin/rm -rf $i +fi +done |
