Changeset 2117
- Timestamp:
- 04/13/08 06:35:19 (5 years ago)
- Location:
- alternc/trunk
- Files:
-
- 16 edited
-
bureau/class/local.php (modified) (2 diffs)
-
debian/changelog (modified) (1 diff)
-
debian/config (modified) (1 diff)
-
debian/postinst (modified) (3 diffs)
-
debian/postrm (modified) (1 diff)
-
install/alternc.install (modified) (7 diffs)
-
install/mysql.sh (modified) (2 diffs)
-
install/upgrade_check.sh (modified) (1 diff)
-
src/basedir_prot.sh (modified) (1 diff)
-
src/fixperms.sh (modified) (1 diff)
-
src/functions.sh (modified) (1 diff)
-
src/sqlbackup.sh (modified) (3 diffs)
-
src/update_domains.sh (modified) (2 diffs)
-
tools/get_account_by_domain (modified) (1 diff)
-
tools/get_domains_by_account (modified) (1 diff)
-
tools/top_http_users (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
alternc/trunk/bureau/class/local.php
r2115 r2117 14 14 $config_file = fopen('/etc/alternc/local.sh', 'r'); 15 15 while (FALSE !== ($line = fgets($config_file))) { 16 if ( ereg('^([A-Z0-9_]*)="([^"]*)"', $line, $regs)) {16 if (preg_match('/^([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $regs)) { 17 17 $GLOBALS['L_'.$regs[1]] = $regs[2]; 18 18 if (isset($compat[$regs[1]])) { … … 23 23 24 24 fclose($config_file); 25 26 $config_file = fopen('/etc/alternc/my.cnf', 'r'); 27 while (FALSE !== ($line = fgets($config_file))) { 28 if (preg_match('/^([A-Za-z0-9_]*) *= *"?(.*?)"?$/', trim($line), $regs)) { 29 switch ($regs[1]) { 30 case "user": 31 $GLOBALS['L_MYSQL_LOGIN'] = $regs[2]; 32 break; 33 case "password": 34 $GLOBALS['L_MYSQL_PWD'] = $regs[2]; 35 break; 36 case "host": 37 $GLOBALS['L_MYSQL_HOST'] = $regs[2]; 38 break; 39 case "database": 40 $GLOBALS['L_MYSQL_DATABASE'] = $regs[2]; 41 break; 42 } 43 } 44 } 45 46 fclose($config_file); -
alternc/trunk/debian/changelog
r2105 r2117 1 1 alternc (0.9.7+dev) stable; urgency=low UNRELEASED 2 2 3 * move mysql configuration into a valid MySQL configuration file 4 (/etc/alternc/my.cnf). This fixes a serious security issue (#318) 5 where the MySQL root password was passed on the commandline. Those 6 changes are pretty invasive and might break upgrades, cron jobs and 7 your cat... 3 8 * standardisation of the web interface, along with some esthetic changes, by 4 9 Marc Angles, sponsored by Koumbit -
alternc/trunk/debian/config
r2048 r2117 38 38 # source the current config 39 39 . /etc/alternc/local.sh 40 fi 41 if [ -r /etc/alternc/my.cnf ]; then 42 # make mysql configuration available as shell variables 43 # to convert from .cnf to shell syntax, we: 44 # * match only lines with "equal" in them (/=/) 45 # * remove whitespace around the = and add a left quote operator ' (;s) 46 # * add a right quote operator at the end of line (;s) 47 # * convert mysql variables into our MYSQL_ naming convention (;s) 48 # * print the result (;p) 49 eval `sed -n -e "/=/{s/ *= */='/;s/\$/'/;s/host/MYSQL_HOST/;s/user/MYSQL_LOGIN/;s/password/MYSQL_PASS/;s/database/MYSQL_DATABASE/;p}" /etc/alternc/my.cnf` 40 50 fi 41 51 -
alternc/trunk/debian/postinst
r2108 r2117 84 84 DEFAULT_MX="" 85 85 86 # MySQL configuration 87 MYSQL_HOST="" 88 MYSQL_DATABASE="" 89 MYSQL_USER="" 90 MYSQL_PASS="" 86 # Note: MySQL username/password configuration now stored in /etc/alternc/my.cnf 87 91 88 # quels clients mysql sont permis (%, localhost, etc) 92 89 MYSQL_CLIENT="" … … 120 117 update_var alternc/bind_internal BIND_INTERNAL 121 118 update_var alternc/default_mx DEFAULT_MX 122 update_var alternc/mysql/host MYSQL_HOST123 update_var alternc/mysql/db MYSQL_DATABASE124 update_var alternc/mysql/user MYSQL_USER125 update_var alternc/mysql/password MYSQL_PASS126 119 update_var alternc/mysql/client MYSQL_CLIENT 127 120 update_var alternc/alternc_location ALTERNC_LOC … … 130 123 mv -f $CONFIGFILE.tmp $CONFIGFILE 131 124 125 # Setup grants 126 db_get "alternc/mysql/host" 127 MYSQL_HOST="$RET" 128 if [ "$MYSQL_HOST" != "localhost" -o -e /usr/sbin/mysqld ]; then 129 # compatibility shims with my.cnf 130 host="$RET" 131 db_get "alternc/mysql/db" 132 database="$RET" 133 db_get "alternc/mysql/user" 134 user="$RET" 135 db_get "alternc/mysql/password" 136 password="$RET" 137 138 # we source (instead of forking) mysql.sh so that it gets the local environment above 139 . /usr/share/alternc/install/mysql.sh 140 fi 141 132 142 # forget the password 133 143 db_reset alternc/mysql/password || true -
alternc/trunk/debian/postrm
r1835 r2117 16 16 case "$1" in 17 17 purge) 18 rm -f /etc/alternc/local.sh /etc/alternc/ bureau.conf18 rm -f /etc/alternc/local.sh /etc/alternc/my.cnf /etc/alternc/bureau.conf 19 19 rm -f /var/backups/alternc/etc-installed.tar.gz 20 20 -
alternc/trunk/install/alternc.install
r1995 r2117 5 5 # on a new server. THIS SCRIPT ERASE ALL DATA ON THE AlternC SYSTEM !! 6 6 # YOU HAVE BEEN WARNED ! 7 8 # This script now assumes it has MySQL connectivity through 9 # /etc/alternc/my.cnf 7 10 8 11 set -e … … 79 82 . /etc/alternc/local.sh 80 83 84 # XXX: copy-paste from debian/config 85 if [ -r /etc/alternc/my.cnf ]; then 86 # make mysql configuration available as shell variables 87 # to convert from .cnf to shell syntax, we: 88 # * match only lines with "equal" in them (/=/) 89 # * remove whitespace around the = and add a left quote operator ' (;s) 90 # * add a right quote operator at the end of line (;s) 91 # * convert mysql variables into our MYSQL_ naming convention (;s) 92 # * print the result (;p) 93 eval `sed -n -e "/=/{s/ *= */='/;s/\$/'/;s/host/MYSQL_HOST/;s/user/MYSQL_LOGIN/;s/password/MYSQL_PASS/;s/database/MYSQL_DATABASE/;p}" /etc/alternc/my.cnf` 94 fi 95 81 96 WARNING="WARNING: Do not edit this file, edit the one in /etc/alternc/templates and launch alternc.install again." 82 97 … … 102 117 fi 103 118 104 SED_SCRIPT=" 119 # XXX: I assume this is secure if /tmp is sticky (+t) 120 # we should have a better way to deal with templating, of course. 121 SED_SCRIPT=`mktemp` 122 cat > $SED_SCRIPT <<EOF 105 123 s\\%%hosting%%\\$HOSTING\\; 106 124 s\\%%fqdn%%\\$FQDN\\; … … 122 140 s\\%%version%%\\$VERSION\\; 123 141 s\\%%ns2_ip%%\\$NS2_IP\\; 124 " 142 EOF 125 143 126 144 ####################################################################### … … 146 164 TEMPLATE="$TEMPLATE_DIR/${file##etc/}" 147 165 if [ -f "$TEMPLATE" ]; then 148 sed -e "$SED_SCRIPT" < $TEMPLATE > /$file 149 fi 150 done 166 sed -f "$SED_SCRIPT" < $TEMPLATE > /$file 167 fi 168 done 169 rm -f $SED_SCRIPT 151 170 152 171 ####################################################################### … … 154 173 # 155 174 tar -zcf "$INSTALLED_CONFIG_TAR" -C / $CONFIG_FILES 156 157 ######################################################################158 # Initialize database159 #160 if [ "$MYSQL_HOST" != "localhost" -o -e /usr/sbin/mysqld ]; then161 echo "Setup MySQL and database..."162 /usr/share/alternc/install/mysql.sh "$MYSQL_HOST" "$MYSQL_USER" "$MYSQL_PASS" "$MYSQL_DATABASE"163 fi164 175 165 176 ######################################################################## … … 264 275 265 276 # Creating admin user if needed 266 HAS_ROOT= "`mysql -h"$MYSQL_HOST" -u"$MYSQL_USER" -p"$MYSQL_PASS" "$MYSQL_DATABASE" -e "SELECT COUNT(*) FROM membres WHERE login = 'admin' OR login = 'root' and su = 1" | tail -1`"277 HAS_ROOT=`mysql --defaults-file=/etc/alternc/my.cnf -e "SELECT COUNT(*) FROM membres WHERE login = 'admin' OR login = 'root' and su = 1" | tail -1` 267 278 if [ "$HAS_ROOT" != "1" ]; then 268 279 echo "Creating admin user..." -
alternc/trunk/install/mysql.sh
r2059 r2117 1 #!/bin/sh 1 #!/bin/sh 2 2 # 3 3 # $Id: mysql.sh,v 1.11 2006/01/11 22:51:28 anarcat Exp $ … … 29 29 # ---------------------------------------------------------------------- 30 30 # 31 32 sqlserver="$1" 33 rootlogin="$2" 34 rootpass="$3" 35 systemdb="$4" 36 37 if [ -z "$rootlogin" -o -z "$rootpass" -o -z "$systemdb" ] 38 then 39 echo "Usage: mysql.sh <mysqlserver> <rootlogin> <rootpass> <systemdb>" 40 exit 1 41 fi 42 43 mysql="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf -h$sqlserver " 31 32 # This script expects the following environment to exist: 33 # * host 34 # * user 35 # * password 36 # * database 37 # 38 # XXX: the sed script should be generated here 39 # 40 # So this file should generally be sourced like this: 41 # . /usr/share/alternc/install/mysql.sh 42 # 43 # Those values are used to set the username/passwords... 44 44 45 45 # The grant all is the most important right needed in this script. 46 echo "Granting users..." 47 # cat <<EOF 48 # host: $host 49 # user: $user 50 # password: $password 51 # database: $database 52 # EOF 53 54 MYSQL_CONFIG="/etc/alternc/my.cnf" 55 56 . /etc/alternc/local.sh 57 # the purpose of this "grant" is to make sure that the generated my.cnf works 58 # this means (a) creating the user and (b) creating the database 59 grant="GRANT ALL ON *.* TO '$user'@'${MYSQL_CLIENT}' IDENTIFIED BY '$password' WITH GRANT OPTION; 60 CREATE DATABASE IF NOT EXISTS $database;" 61 62 echo -n "Trying debian.cnf: " 63 mysql="/usr/bin/mysql --defaults-file=/etc/mysql/debian.cnf" 46 64 # If this call fail, we may be connected to a mysql-server version 5.0. 47 echo "Granting users " 48 # In that case, change mysql parameters and retry. Use root / nopassword. 49 $ mysql -e "GRANT ALL ON *.* TO '$rootlogin'@'${MYSQL_CLIENT}' IDENTIFIED BY '$rootpass' WITH GRANT OPTION"50 if [ "$?" -ne "0" ] 65 # In that case, change mysql parameters and retry. Use root / nopassword. 66 if ! $mysql <<EOF 67 $grant 68 EOF 51 69 then 52 echo "debian-sys-maintainer doesn't have the right credentials, assuming we're doing an upgrade" 53 mysql="/usr/bin/mysql -h$sqlserver -u$rootlogin -p$rootpass" 54 $mysql -e "GRANT ALL ON *.* TO '$rootlogin'@'${MYSQL_CLIENT}' IDENTIFIED BY '$rootpass' WITH GRANT OPTION" 55 if [ "$?" -ne "0" ] 56 then 57 echo "Still not working, assuming clean install and empty root password" 58 mysql="/usr/bin/mysql -h$sqlserver -uroot " 59 $mysql -e "GRANT ALL ON *.* TO '$rootlogin'@'${MYSQL_CLIENT}' IDENTIFIED BY '$rootpass' WITH GRANT OPTION" 60 if [ "$?" -ne "0" ] 70 echo "failed: debian-sys-maintainer doesn't have the right credentials" 71 echo -n "are we doing an upgrade? " 72 mysql="/usr/bin/mysql --defaults-file=$MYSQL_CONFIG" 73 if ! $mysql <<EOF 74 $grant 75 EOF 76 then 77 echo "No" 78 echo -n "Assuming clean install (empty root password)... " 79 mysql="/usr/bin/mysql -h$host -uroot " 80 if ! $mysql <<EOF 81 $grant 82 EOF 61 83 then 62 echo "Can't grant system user $rootlogin, aborting"; 63 exit 1 84 echo "Failed" 85 echo -n "Assuming pre 0.9.8 version... " 86 mysql="/usr/bin/mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS" 87 if ! $mysql <<EOF 88 $grant 89 EOF 90 then 91 echo "No." 92 echo "Can't grant system user $user, aborting"; 93 exit 1 94 fi 64 95 fi 65 96 fi 66 97 fi 98 echo "ok!" 67 99 68 # Now we can use rootlogin and rootpass. 69 mysql="/usr/bin/mysql -h$sqlserver -u$rootlogin -p$rootpass" 100 if [ -f $MYSQL_CONFIG ]; then 101 echo "Updating mysql configuration in $MYSQL_CONFIG" 102 else 103 echo "Creating mysql configuration in $MYSQL_CONFIG" 104 cat > $MYSQL_CONFIG <<EOF 105 # AlternC - Web Hosting System - MySQL Configuration 106 # Automatically generated by AlternC configuration, do not edit 107 # This file will be modified on package configuration 108 # (e.g. upgrade or dpkg-reconfigure alternc) 109 [client] 110 EOF 111 chown root:www-data $MYSQL_CONFIG 112 chmod 640 $MYSQL_CONFIG 113 fi 70 114 71 echo "Setting AlternC '$systemdb' system table and privileges " 72 $mysql -e "CREATE DATABASE IF NOT EXISTS $systemdb;" 115 # create a sed script to create/update the file 116 function set_value() { 117 var=$1 118 RET=$2 119 grep -Eq "^ *$var=" $MYSQL_CONFIG || echo "$var=" >> $MYSQL_CONFIG 120 SED_SCRIPT="$SED_SCRIPT;s\\^ *$var=.*\\$var=\"$RET\"\\" 121 } 73 122 74 echo "Installing AlternC schema " 75 $mysql $systemdb < /usr/share/alternc/install/mysql.sql 123 SED_SCRIPT="" 124 # hostname was empty in older (pre-0.9.6?) versions 125 if [ -z "$host" ]; then 126 host="localhost" 127 fi 128 set_value host $host 129 set_value database $database 130 set_value user $user 131 set_value password $password 76 132 77 /usr/bin/mysql -h$sqlserver -u$rootlogin -p$rootpass $systemdb -e "SHOW TABLES" >/dev/null && echo "MYSQL.SH OK!" || echo "MYSQL.SH FAILED!" 133 # take extra precautions here with the mysql password: 134 # put the sed script in a temporary file 135 SED_SCRIPT_NAME=`mktemp` 136 cat > $SED_SCRIPT_NAME <<EOF 137 $SED_SCRIPT 138 EOF 139 sed -f "$SED_SCRIPT_NAME" < $MYSQL_CONFIG > $MYSQL_CONFIG.$$ 140 mv -f $MYSQL_CONFIG.$$ $MYSQL_CONFIG 141 rm -f $SED_SCRIPT_NAME 142 143 # Now we should be able to use the mysql configuration 144 mysql="/usr/bin/mysql --defaults-file=$MYSQL_CONFIG" 145 146 echo "Checking for MySQL connectivity" 147 $mysql -e "SHOW TABLES" >/dev/null && echo "MYSQL.SH OK!" || echo "MYSQL.SH FAILED!" 148 149 # Final mysql setup: db schema 150 echo "installing AlternC schema in $database..." 151 $mysql < /usr/share/alternc/install/mysql.sql || echo cannot load database schema 152 -
alternc/trunk/install/upgrade_check.sh
r1798 r2117 46 46 case "$ext" in 47 47 sql) 48 mysql -f - h $MYSQL_HOST -u $MYSQL_USER -p$MYSQL_PASS $MYSQL_DATABASE\48 mysql -f --defaults-file=/etc/alternc/my.cnf \ 49 49 < $file || true 50 50 ;; -
alternc/trunk/src/basedir_prot.sh
r1922 r2117 18 18 . /etc/alternc/local.sh 19 19 . /usr/lib/alternc/functions.sh 20 21 if [ -z "$MYSQL_HOST" ]22 then23 MYSQL_HOST="localhost"24 fi25 20 26 21 echo -n "adding open_base_dir protection for:" -
alternc/trunk/src/fixperms.sh
r1646 r2117 64 64 } 65 65 66 mysql - h"$MYSQL_HOST" -p"$MYSQL_PASS" -u"$MYSQL_USER" "$MYSQL_DATABASE"-B -e "select uid,login from membres" |grep -v ^uid|doone66 mysql --defaults-file=/etc/alternc/my.cnf -B -e "select uid,login from membres" |grep -v ^uid|doone 67 67 -
alternc/trunk/src/functions.sh
r2050 r2117 310 310 # implantons localement ce que nous avons besoin, puisque admintools 311 311 # n'est pas là 312 mysql - h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE-B -N -e \312 mysql --defaults-file=/etc/alternc/my.cnf -B -N -e \ 313 313 'SELECT a.login FROM membres a, sub_domaines b WHERE a.uid = b.compte AND \ 314 314 CONCAT(IF(sub="", "", CONCAT(sub, ".")), domaine) = "'"$1"'" LIMIT 1;' -
alternc/trunk/src/sqlbackup.sh
r1796 r2117 29 29 30 30 set -e 31 32 # Get mysql user and password :33 . /etc/alternc/local.sh34 31 35 32 function dobck { … … 64 61 "${target_dir}/${db}.sql.${i}${ext}" 2>/dev/null || true 65 62 if [ "$compressed" -eq 1 ]; then 66 mysqldump - h"$MYSQL_HOST" -u"$login" -p"$pass" "$db"--add-drop-table --allow-keywords -Q -f -q -a -e |63 mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords -Q -f -q -a -e | 67 64 gzip -c > "${target_dir}/${db}.sql${ext}" 68 65 else 69 mysqldump - h"$MYSQL_HOST" -u"$login" -p"$pass" "$db"--add-drop-table --allow-keywords -Q -f -q -a -e \66 mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords -Q -f -q -a -e \ 70 67 > "${target_dir}/${db}.sql" 71 68 fi … … 84 81 fi 85 82 86 /usr/bin/mysql -h"$MYSQL_HOST" -u"$MYSQL_USER" -p"$MYSQL_PASS" \ 87 "$MYSQL_DATABASE" -B << EOF | tail -n '+2' | dobck 83 /usr/bin/mysql --defaults-file=/etc/alternc/my.cnf -B << EOF | tail -n '+2' | dobck 88 84 SELECT login, pass, db, bck_history, bck_gzip, bck_dir 89 85 FROM db -
alternc/trunk/src/update_domains.sh
r1993 r2117 75 75 . "$CONFIG_FILE" 76 76 77 if [ -z "$MYSQL_HOST" -o -z "$MYSQL_DATABASE" -o -z "$MYSQL_USER" -o \ 78 -z "$MYSQL_PASS" -o -z "$DEFAULT_MX" -o -z "$PUBLIC_IP" ]; then 77 if [ -z "$DEFAULT_MX" -o -z "$PUBLIC_IP" ]; then 79 78 echo "Bad configuration. Please use:" 80 79 echo " dpkg-reconfigure alternc" … … 97 96 HTML_HOME="$DATA_ROOT/html" 98 97 99 MYSQL_SELECT="mysql -h${MYSQL_HOST} -u${MYSQL_USER} 100 -p${MYSQL_PASS} -Bs ${MYSQL_DATABASE}" 101 MYSQL_DELETE="mysql -h${MYSQL_HOST} -u${MYSQL_USER} 102 -p${MYSQL_PASS} ${MYSQL_DATABASE}" 98 MYSQL_SELECT="mysql --defaults-file=/etc/alternc/my.cnf -Bs " 99 MYSQL_DELETE="mysql --defaults-file=/etc/alternc/my.cnf " 103 100 104 101 ######################################################################## -
alternc/trunk/tools/get_account_by_domain
r877 r2117 76 76 # Have to get AlternC conf file : 77 77 ! [ -f "$ALTERNC_CONF_FILE" ] && { echo $MISSING_CONF_FILE ; exit 1 ; } || . $ALTERNC_CONF_FILE 78 # Must have access to mysql to retreive accounts owning domains : 79 [ -z "$MYSQL_HOST" ] && MYSQL_HOST=localhost 80 $mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE -e "select count(*) from domaines_standby;" > /dev/null 2>&1 81 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } || mysql="$mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE -B -N -e " 78 mysql="$mysql --defaults-file=/etc/alternc/my.cnf" 79 $mysql -e "select count(*) from domaines_standby;" > /dev/null 2>&1 80 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } 82 81 83 82 # Does the stuff 84 $mysql "select concat(a.login, \" (\", a.mail, \")\") from membres a, sub_domaines b where a.uid = b.compte and concat(if(sub=\"\", \"\", concat(sub, \".\")), domaine) = \"${1}\";"83 $mysql -B -N -e "select concat(a.login, \" (\", a.mail, \")\") from membres a, sub_domaines b where a.uid = b.compte and concat(if(sub=\"\", \"\", concat(sub, \".\")), domaine) = \"${1}\";" 85 84 86 85 -
alternc/trunk/tools/get_domains_by_account
r877 r2117 75 75 ! [ -f "$ALTERNC_CONF_FILE" ] && { echo $MISSING_CONF_FILE ; exit 1 ; } || . $ALTERNC_CONF_FILE 76 76 # Must have access to mysql to retreive accounts owning domains : 77 [ -z "$MYSQL_HOST" ] && MYSQL_HOST=localhost 78 $mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE -e"select count(*) from domaines_standby;" > /dev/null 2>&179 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } || mysql="$mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE -B -N -e "77 mysql="$mysql --defaults-file=/etc/alternc/my.cnf -B -N -e" 78 $mysql "select count(*) from domaines_standby;" > /dev/null 2>&1 79 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } 80 80 81 81 # Does the stuff -
alternc/trunk/tools/top_http_users
r1605 r2117 169 169 [ -f "$ALTERNC_CONF_FILE" ] || { echo $MISSING_CONF_FILE ; exit 1 ; } && . $ALTERNC_CONF_FILE 170 170 # Must have access to mysql to retreive accounts owning domains : 171 [ -z "$MYSQL_HOST" ] && MYSQL_HOST=localhost 172 $mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE -e "select count(*) from domaines_standby;" > /dev/null 2>&1 173 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } || mysql="$mysql -h$MYSQL_HOST -u$MYSQL_USER -p$MYSQL_PASS -D$MYSQL_DATABASE -B -N -e " 174 171 mysql="$mysql --defaults-file=/etc/alternc/my.cnf -B -N -e" 172 $mysql "select count(*) from domaines_standby;" > /dev/null 2>&1 173 [ "$?" != 0 ] && { echo "$MYSQL_UNREACHABLE_DATABASE" ; exit 1 ; } 175 174 # Prevents executing more than one shell at the same time 176 175 $lockfilecreate --retry 1 $LOCK_FILE
Note: See TracChangeset
for help on using the changeset viewer.
