thiur / gnizr

Automatically exported from code.google.com/p/gnizr
Other
0 stars 0 forks source link

Warn db overwrite when running the install script #67

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If the mysql database is populated with gnizr data, running the
'loadsch.sh' script should warn the user that the existing db data will be
lost. 

Original issue reported on code.google.com by harry.c...@gmail.com on 30 May 2008 at 1:55

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Based on rick's suggestion (may 29, 08), 

  http://code.google.com/p/gnizr/wiki/SetupGnizrDatabase

I modified his script and added the following:

rows=`mysql -u $USER -p${PASS} -e "show tables" $DB |wc -l`
if [ $rows -gt 0 ]
  then echo "Looks like the gnizr has already been installed."
       echo "Enter YES to continue (ALL EXISTING DATA WILL BE LOST!): "
       read input
       if [ "$input" != "YES" ] 
          then echo "Quit! No changes are made."
               exit 1
       fi 
fi 

Original comment by harry.c...@gmail.com on 4 Jun 2008 at 3:56