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.3 2005-04-12 20:45:55 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/functions/mysqlfunctions,v 1.4 2005-08-17 21:20:39 niro Exp $ |
10 |
|
|
11 |
mysql_command(){ |
mysql_command(){ |
12 |
|
|
104 |
EOF |
EOF |
105 |
[ "${SHOWTABLES}" == true ] || echo "${i}" |
[ "${SHOWTABLES}" == true ] || echo "${i}" |
106 |
} |
} |
107 |
|
|
108 |
|
beep3x() { |
109 |
|
echo -en "\a" |
110 |
|
sleep 0.7 |
111 |
|
echo -en "\a" |
112 |
|
sleep 0.7 |
113 |
|
echo -en "\a" |
114 |
|
} |
115 |
|
|
116 |
|
reach_mysql_server() |
117 |
|
{ |
118 |
|
# set connection timeout to 5 secs |
119 |
|
mysql --connect_timeout=5 \ |
120 |
|
--user=${SQL_USER} \ |
121 |
|
--password=${SQL_PASS} \ |
122 |
|
--host=${SQL_HOST} \ |
123 |
|
--database=${SQL_DB} \ |
124 |
|
--batch \ |
125 |
|
--execute="" $> /dev/null && return 0 || \ |
126 |
|
( |
127 |
|
echo -e ${COLRED} |
128 |
|
echo "Cannot reach a mysql-server at '${SQL_HOST}'." |
129 |
|
echo "None of the current settings of this client will be touched." |
130 |
|
echo "Please inform your system-administrator." |
131 |
|
echo -e ${COLDEFAULT} |
132 |
|
beep3x |
133 |
|
sleep 5 |
134 |
|
return 1 |
135 |
|
) |
136 |
|
} |