[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC] prepare-database script
- Subject: Re: [RFC] prepare-database script
- From: Luke <..hidden..>
- Date: Thu, 2 Jun 2011 19:49:50 -0400 (EDT)
Here's one to add root checking:
--- ./prepare-company-database.sh 2011-06-02 18:23:26.851794751 -0400
+++ ./prepare-company-database.sh.new 2011-06-02 19:47:01.000000000 -0400
@@ -74,6 +74,13 @@
}
+# Am I root?
+if ! test `whoami` = root
+then
+echo "Warning: you are not running as root;"
+echo "you will need the postgres user's password."
+fi
+
# Extract options and setup variables
if ! options=$( getopt -u -l company:,coa:,gifi:,srcdir:,dstdir:,password:,host:,port:,help,progress,pgsql-contrib: '' "$@" )
then