github.com/canhui/fabric_ca2_2@v2.0.0-alpha+incompatible/images/fabric-ca-fvt/payload/mysql_setup.sh (about)

     1  #!/bin/bash
     2  RC=0
     3  arch=$(uname -m)
     4  
     5  mkdir -p /var/run/mysqld
     6  chown mysql:mysql /var/run/mysqld
     7  
     8  # Mysql certificates
     9  cp $FABRIC_CA_DATA/$TLS_BUNDLE $MYSQLDATA/
    10  cp $FABRIC_CA_DATA/$TLS_SERVER_CERT $MYSQLDATA/
    11  openssl rsa -in $FABRIC_CA_DATA/$TLS_SERVER_KEY -out $MYSQLDATA/$TLS_SERVER_KEY || let RC+=1
    12  chown mysql.mysql $MYSQLDATA/*pem
    13  chmod 600 $MYSQLDATA/$TLS_SERVER_KEY
    14  test $arch = s390x && MYCNF=/etc/mysql/my.cnf || MYCNF=/etc/mysql/mysql.conf.d/mysqld.cnf
    15  sed -i "s/^[[:blank:]]*#*[[:blank:]]*ssl-ca=.*/ssl-ca=$TLS_BUNDLE/;
    16          s/\(^[[:blank:]]*\)#*\([[:blank:]]*max_connections[[:blank:]]*=[[:blank:]]*\).*/\1\22000/;
    17          s/^[[:blank:]]*#*[[:blank:]]*ssl-cert=.*/ssl-cert=$TLS_SERVER_CERT/;
    18          s/^[[:blank:]]*#*[[:blank:]]*ssl-key=.*/ssl-key=$TLS_SERVER_KEY/" $MYCNF || let RC+=1
    19  chown -R mysql.mysql $MYSQLDATA
    20  exit $RC