Magellan Linux

Diff of /alx-src/trunk/alxconfig-ng/functions/mysqlfunctions

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 284 by niro, Wed Aug 17 21:20:39 2005 UTC revision 344 by niro, Sun Oct 9 21:32:33 2005 UTC
# Line 6  Line 6 
6  #  #
7  # Niels Rogalla <niro@magellan-linux.de>  # Niels Rogalla <niro@magellan-linux.de>
8  #  #
9  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/mysqlfunctions,v 1.4 2005-08-17 21:20:39 niro Exp $  # $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/mysqlfunctions,v 1.8 2005-10-09 21:32:33 niro Exp $
10    
11  mysql_command(){  mysql_command()
12    {
13    
14   local SQL_USER   local SQL_USER
15   local SQL_PASS   local SQL_PASS
# Line 49  mysql_command(){ Line 50  mysql_command(){
50   return 0   return 0
51  }  }
52    
53  mysql_enum_colums(){  mysql_enum_colums()
54    {
55   local SQL_USER   local SQL_USER
56   local SQL_PASS   local SQL_PASS
57   local SQL_HOST   local SQL_HOST
# Line 105  EOF Line 107  EOF
107   [ "${SHOWTABLES}" == true ] || echo "${i}"   [ "${SHOWTABLES}" == true ] || echo "${i}"
108  }  }
109    
110  beep3x() {  beep3x()
111    {
112   echo -en "\a"   echo -en "\a"
113   sleep 0.7   sleep 0.7
114   echo -en "\a"   echo -en "\a"
# Line 115  beep3x() { Line 118  beep3x() {
118    
119  reach_mysql_server()  reach_mysql_server()
120  {  {
121   # set connection timeout to 5 secs   # set connection timeout to 20 secs
122   mysql --connect_timeout=5 \   mysql --connect_timeout=20 \
123   --user=${SQL_USER} \   --user="${SQL_USER}" \
124   --password=${SQL_PASS} \   --password="${SQL_PASS}" \
125   --host=${SQL_HOST} \   --host="${SQL_HOST}" \
126   --database=${SQL_DB} \   --database="${SQL_DB}" \
127   --batch \   --batch \
128   --execute="" $> /dev/null && return 0 || \   --execute="" &> /dev/null && return 0 || \
129   (   (
130   echo -e ${COLRED}   echo -e ${COLRED}
131   echo "Cannot reach a mysql-server at '${SQL_HOST}'."   echo "Cannot reach a mysql-server at '${SQL_HOST}'."
# Line 134  reach_mysql_server() Line 137  reach_mysql_server()
137   return 1   return 1
138   )   )
139  }  }
140    
141    mysqldo()
142    {
143     mysql_command \
144     "${SQL_USER}" \
145     "${SQL_PASS}" \
146     "${SQL_HOST}" \
147     "${SQL_DB}" \
148     "$@" \
149     && return 0 || return 1
150    }

Legend:
Removed from v.284  
changed lines
  Added in v.344