updates to add centos install support
This commit is contained in:
parent
6d68034177
commit
fb5f1a771c
1 changed files with 33 additions and 18 deletions
51
install.sh
51
install.sh
|
@ -3,23 +3,11 @@
|
||||||
# exit on error
|
# exit on error
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# detect os/ver for install type
|
function install_python_depencencies() {
|
||||||
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
|
|
||||||
sudo python3 -m pip install -r daemon/requirements.txt
|
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
|
git clone https://github.com/USNavalResearchLaboratory/ospf-mdr /tmp/ospf-mdr
|
||||||
cd /tmp/ospf-mdr
|
cd /tmp/ospf-mdr
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
|
@ -29,12 +17,39 @@ if [[ ${os} == "Ubuntu" ]]; then
|
||||||
make -j8
|
make -j8
|
||||||
sudo make install
|
sudo make install
|
||||||
cd -
|
cd -
|
||||||
|
}
|
||||||
|
|
||||||
# build and install core
|
function install_core() {
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
./configure
|
./configure
|
||||||
make -j8
|
make -j8
|
||||||
sudo make install
|
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
|
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
|
||||||
|
|
Loading…
Add table
Reference in a new issue