Skip to content
Snippets Groups Projects
Select Git revision
  • 31930d24e433e91db33d83f84d58e5941cb850f7
  • master default protected
  • simple-task/7248-eol-check-add-node-22
  • 6877_check_iml_deployment
4 results

autodetect-mysqlany

Blame
  • autodetect-mysqlany 932 B
    # ----------------------------------------------------------------------------
    # 
    # EOL - End of life detection - Warn before reaching end of life
    #
    # AUTODETECT MYSQL OR A FORK OF IT
    #
    # ----------------------------------------------------------------------------
    # 2021-11-02  v1.0  <axel.hahn@iml.unibe.ch>
    # ----------------------------------------------------------------------------
    
    _tmpfile=/tmp/detect_mysql_$$
    mysql --version >$_tmpfile 2>&1
    if [ $? -ne 0 ]; then
        rm -f $_tmpfile
        ph.abort "UNKNOWN: mysql was not found. A Mysql version cannot be detected."
    fi
    
    # ----------------------------------------------------------------------------
    
    # default: mysql
    myKey=mysql
    
    
    # scan for forks:
    # todo: add ... percona ... memdb ... whatever
    grep "MariaDB" $_tmpfile >/dev/null && myKey=mariadb
    
    rm -f $_tmpfile
    
    # ----------------------------------------------------------------------------
    
    echo "|$myKey|$myVersion"