Changeset 388


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

redmine-user: cloudify

File:
1 edited

Legend:

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

    r352 r388  
    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 {
     
    7682fi
    7783
    78 project=`echo "SELECT id FROM projects WHERE identifier='$project' ORDER BY id DESC LIMIT 1" | mysql $DataBase -N -B`
     84project=`echo "SELECT id FROM projects WHERE identifier='$project' ORDER BY id DESC LIMIT 1" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host`
    7985
    8086if [ -z "$login" ]
     
    134140
    135141# Password encrypt
    136 sha=`mysql $DataBase -N -B -e "SELECT SHA1('$password');"`
     142sha=`mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host -e "SELECT SHA1('$password');"`
    137143echo "Pass Sha1 : $sha"
    138144password=$sha
    139145
    140146now=`date +"%F %X"`
    141 idUser=`echo "SELECT id FROM users ORDER BY id DESC LIMIT 1 ;" | mysql $DataBase -N -B `
     147idUser=`echo "SELECT id FROM users ORDER BY id DESC LIMIT 1 ;" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host`
    142148
    143149echo "Last user : $idUser"
     
    145151
    146152idUser=$(( $idUser + 1 ))
    147 memberID=`echo "SELECT id FROM members ORDER BY id DESC LIMIT 1 ;" | mysql $DataBase -N -B`
     153memberID=`echo "SELECT id FROM members ORDER BY id DESC LIMIT 1 ;" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host`
    148154memberID=$(( $memberID + 1 ))
    149155
    150 echo "INSERT INTO users VALUES ($idUser,'$login','$password','$firstname','$lastname','$email',0,0,1,NULL,'$langue',NULL,'$now','$now','User')" | mysql $DataBase -N -B
    151 echo "INSERT INTO members VALUES ($memberID,$idUser,$project,3,'$now',1)" | mysql $DataBase -N -B
     156echo "INSERT INTO users VALUES ($idUser,'$login','$password','$firstname','$lastname','$email',0,0,1,NULL,'$langue',NULL,'$now','$now','User')" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host
     157echo "INSERT INTO members VALUES ($memberID,$idUser,$project,3,'$now',1)" | mysql $DataBase -N -B -u$mysql_user -p$mysql_pass -h$mysql_host
Note: See TracChangeset for help on using the changeset viewer.