#!/bin/bash

function install_jq() {
    log_info "install package jq."
    rpm -Uvh Install_Packages/oniguruma-5.9.5-3.el7.x86_64.rpm
    rpm -Uvh Install_Packages/jq-1.5-1.el7.x86_64.rpm
}

function install_iperf3() {
    # install iperf3
    log_info "install package iperf3"
    rpm -Uvh Install_Packages/iperf3-3.1.3-1.fc24.x86_64.rpm
}

function install_fio() {
    # install fio
    log_info "install package fio"
    rpm -Uvh Install_Packages/fio-3.2-1.el7.x86_64.rpm
}

function install_bc() {
    # install bc
    log_info "install package bc"
    rpm -Uvh Install_Packages/bc-1.06.95-13.el7.x86_64.rpm
}

function install_mc() {
    # install mc
    log_info "install s3 tool mc"
    cp Install_Packages/mc /usr/local/sbin
    chmod +x /usr/local/sbin/mc 
}

function install_ipcalc() {
    # install install_ipcalc
    log_info "install ipcalc"
    if ! $(which ipcalc &> /dev/null);then
        rpm -ivh Install_Packages/ipcalc*.rpm
    fi
}

function install_requirements() {
    install_jq
    install_fio
    install_iperf3
    install_bc
    install_mc
    install_ipcalc
}
