updates to add centos install support

This commit is contained in:
Blake Harnden 2019-12-21 02:45:05 -05:00
parent 6d68034177
commit fb5f1a771c

View file

@ -3,23 +3,11 @@
# exit on error
set -e
# detect os/ver for install type
os=""
if [[ -f /etc/os-release ]]; then
. /etc/os-release
os=${NAME}
fi
# check install was found
if [[ ${os} == "Ubuntu" ]]; then
# install system dependencies
sudo apt install -y automake pkg-config gcc libev-dev bridge-utils ebtables gawk \
python3.6 python3.6-dev python3-pip python3-tk tk libtk-img ethtool libtool libreadline-dev autoconf
# install python dependencies
function install_python_depencencies() {
sudo python3 -m pip install -r daemon/requirements.txt
}
# make and install ospf mdr
function install_ospf_mdr() {
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr /tmp/ospf-mdr
cd /tmp/ospf-mdr
./bootstrap.sh
@ -29,12 +17,39 @@ if [[ ${os} == "Ubuntu" ]]; then
make -j8
sudo make install
cd -
}
# build and install core
function install_core() {
./bootstrap.sh
./configure
make -j8
sudo make install
else
echo "unknown os ${os} cannot install"
}
# detect os/ver for install type
os=""
if [[ -f /etc/os-release ]]; then
. /etc/os-release
os=${NAME}
fi
# check install was found
case ${os} in
"Ubuntu")
sudo apt install -y automake pkg-config gcc libev-dev bridge-utils ebtables gawk \
python3.6 python3.6-dev python3-pip python3-tk tk libtk-img ethtool libtool libreadline-dev autoconf
install_python_depencencies
install_ospf_mdr
install_core
;;
"CentOS Linux")
sudo yum install -y automake pkgconf-pkg-config gcc libev-devel bridge-utils iptables-ebtables gawk \
python36 python36-devel python3-pip python3-tk tk ethtool libtool readline-devel autoconf
install_python_depencencies
install_ospf_mdr
install_core
;;
*)
echo "unknown os ${os} cannot install"
;;
esac