[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3268] trunk/tools/delete-company-database.sh



Revision: 3268
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3268&view=rev
Author:   ehuelsmann
Date:     2011-06-17 08:28:11 +0000 (Fri, 17 Jun 2011)

Log Message:
-----------
* tools/detele-company-database.sh: Patch submitted by Luke, adding usage description.

Modified Paths:
--------------
    trunk/tools/delete-company-database.sh

Modified: trunk/tools/delete-company-database.sh
===================================================================
--- trunk/tools/delete-company-database.sh	2011-06-17 00:09:58 UTC (rev 3267)
+++ trunk/tools/delete-company-database.sh	2011-06-17 08:28:11 UTC (rev 3268)
@@ -1,5 +1,15 @@
 #!/bin/sh
 
+# Simple check to print usage, and prevent runaway deletion
+if test -z "$1"
+then
+  echo "Usage: $0 COMPANY [ USER ]"
+  echo "\"COMPANY\" is the name of the company database, such as the name given"
+  echo "to --company when using the prepare-company-database.sh script."
+  echo "\"USER\" is an optional PGSQL user (owner of the database) to remove."
+  exit 1
+fi
+
 cmd="select rolname FROM pg_roles WHERE rolname LIKE 'lsmb_${1}__%';"
 company_roles=`su -c "psql -U postgres -t -c \"$cmd\"" postgres`
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.