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

Re: [RFC] prepare-database script



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