Changeset 387


Ignore:
Timestamp:
Mar 22, 2010, 4:59:00 PM (11 years ago)
Author:
lucas
Message:

redmine-pass: cloudify

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ror-farm/redmine/redmine-pass

    r352 r387  
    1818
    1919defaultDB="admin_prod"
     20User="rormanager"
     21
     22# Parse MySQL config
     23mysql_user=$(cat /home/$User/.my.cnf | grep "^user" | awk '{print $3}')
     24mysql_pass=$(cat /home/$User/.my.cnf | grep "^pass" | awk '{print $3}')
     25mysql_host="twix9"
    2026
    2127function usage {
     
    7278fi
    7379
    74 verif=`echo "SELECT count(id) FROM users WHERE login='$login'" | mysql $DataBase -N -B `
     80verif=`echo "SELECT count(id) FROM users WHERE login='$login'" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host`
    7581
    7682if [ "$verif" != "1" ]
     
    8288
    8389# Password encrypt
    84 sha=`mysql $DataBase -N -B -e "SELECT SHA1('$password');"`
     90sha=`mysql $DataBase -N -B  -u$mysql_user -p$mysql_pass -h$mysql_host -e "SELECT SHA1('$password');"`
    8591echo "Pass Sha1 : $sha"
    8692password=$sha
    8793
    88 echo "UPDATE users SET hashed_password='$password' WHERE login='$login' LIMIT 1 ;" | mysql $DataBase -N -B
     94echo "UPDATE users SET hashed_password='$password' WHERE login='$login' LIMIT 1 ;" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host
Note: See TracChangeset for help on using the changeset viewer.