-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.sh
executable file
·49 lines (42 loc) · 1.16 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script might need root privileges!" 1>&2
fi
CWD=`dirname $0`
SCRIPT=$(readlink -f $0)
DIR=`dirname $SCRIPT`
BIN=`(awk -F "=" '/quagga_path=/ { print $NF }' $DIR/fibbingnode/res/default.cfg)`
quagga() {
git submodule init || exit 1
git submodule update || exit 1
if ! getent group quagga ; then
echo "Creating group quagga"
groupadd quagga
fi
if ! getent passwd quagga ; then
echo "Creating user quagga"
useradd -g quagga quagga
fi
if ! id -nG quagga | grep -qw quagga ; then
echo "Adding user quagga to the group quagga"
usermod -a -G quagga quagga
fi
mkdir -p ${BIN}
chown ${USER} ${BIN}
QUAGGA=${DIR}/Quagga
cd ${QUAGGA}
# For some reasons (e.g. on Debian) autoreconf fails to copy ltmain.sh after the first run ...
autoreconf -vfi
# But succeeds after the second one.
autoreconf -vfi
./configure --prefix=${BIN} --enable-multipath=0 --enable-vtysh --enable-withdraw
make -j 4
make install
cd ${CWD}
}
fibbing() {
cd ${DIR}
pip install -e ".[draw, tests]"
cd ${CWD}
}
quagga && fibbing