Browse code

- more error checkings

git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@1715 689a6050-402a-0410-94f2-e92a70836424

Bogdan-Andrei Iancu authored on 28/02/2007 16:35:55
Showing 1 changed files
... ...
@@ -571,7 +571,7 @@ CREATE TABLE usr_preferences (
571 571
   attribute varchar(32) NOT NULL default '',
572 572
   value varchar(128) NOT NULL default '',
573 573
   type int NOT NULL default '0',
574
-  modified $TIMESTAMP
574
+  last_modified $TIMESTAMP
575 575
 ) $TABLE_TYPE;
576 576
 CREATE INDEX ua_idx ON usr_preferences(uuid,attribute);
577 577
 CREATE INDEX uda_idx ON usr_preferences($USERCOL,domain,attribute);
... ...
@@ -690,6 +690,12 @@ $GRANT_CMD
690 690
 
691 691
 EOF
692 692
 
693
+if [ $? -ne 0 ] ; then
694
+	echo "Creating core tables failed!"
695
+	exit 1;
696
+fi
697
+echo "Core OpenSER tables succesfully created."
698
+
693 699
 echo -n "Install presence related tables ?(y/n):"
694 700
 read INPUT
695 701
 if [ "$INPUT" = "y" ] || [ "$INPUT" = "Y" ]
... ...
@@ -853,9 +859,12 @@ $GRANT_PRESENCE_CMD
853 853
 
854 854
 EOF
855 855
 
856
-	if [ $? -eq 0 ] ; then
857
-		echo "...presence tables created"
858
-	fi
856
+if [ $? -ne 0 ] ; then
857
+	echo "Failed to create presence tables!"
858
+	exit 1
859
+fi
860
+
861
+echo "Presence tables succesfully created."
859 862
 }  # end presence_create
860 863
 
861 864
 
... ...
@@ -977,9 +986,12 @@ $GRANT_EXTRA_CMD
977 977
 
978 978
 EOF
979 979
 
980
-	if [ $? -eq 0 ] ; then
981
-		echo "...extra tables created"
982
-	fi
980
+if [ $? -ne 0 ] ; then
981
+	echo "Failed to create extra tables!"
982
+	exit 1
983
+fi
984
+
985
+echo "Extra tables succesfully created."
983 986
 }  # end extra_create
984 987
 
985 988
 
... ...
@@ -1206,22 +1218,25 @@ $GRANT_SERWEB_CMD
1206 1206
 
1207 1207
 EOF
1208 1208
 
1209
-	if [ $? -eq 0 ] ; then
1210
-		echo "...serweb tables created"
1211
-		echo ""
1212
-		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
1213
-		echo "!                                                 !"
1214
-		echo "!                  WARNING                        !"
1215
-		echo "!                                                 !"
1216
-		echo "! There was a default admin user created:         !"
1217
-		echo "!    username: admin@$SIP_DOMAIN "
1218
-		echo "!    password: $DBRWPW       "
1219
-		echo "!                                                 !"
1220
-		echo "! Please change this password or remove this user !"
1221
-		echo "! from the subscriber and admin_privileges table. !"
1222
-		echo "!                                                 !"
1223
-		echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
1224
-	fi
1209
+if [ $? -ne 0 ] ; then
1210
+	echo "Failed to create serweb tables!"
1211
+	exit 1
1212
+fi
1213
+
1214
+echo "SERWEB tables succesfully created."
1215
+echo ""
1216
+echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
1217
+echo "!                                                 !"
1218
+echo "!                  WARNING                        !"
1219
+echo "!                                                 !"
1220
+echo "! There was a default admin user created:         !"
1221
+echo "!    username: admin@$SIP_DOMAIN "
1222
+echo "!    password: $DBRWPW  "
1223
+echo "!                                                 !"
1224
+echo "! Please change this password or remove this user !"
1225
+echo "! from the subscriber and admin_privileges table. !"
1226
+echo "!                                                 !"
1227
+echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
1225 1228
 
1226 1229
 }  # end serweb_create
1227 1230