1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 11:12:06 +00:00
iiab/iiab-network

52 lines
1.3 KiB
Text
Raw Normal View History

#!/bin/bash
2017-10-30 17:57:55 +00:00
# running from a git repo
# ansible files exist
2017-10-24 16:39:49 +00:00
CWD=`pwd`
2017-10-30 17:57:55 +00:00
export ANSIBLE_LOG_PATH="$CWD/iiab-network.log"
2017-10-24 16:39:49 +00:00
if [ ! -f iiab-network.yml ]; then
echo "IIAB Playbook not found."
echo "Please run this command from the top level of the git repo."
echo "Exiting."
exit 1
fi
if [ ! -f /etc/iiab/config_vars.yml ]; then
mkdir -p /etc/iiab
echo "{}" > /etc/iiab/config_vars.yml
fi
2017-12-07 23:48:35 +00:00
OS="unknown" # will be overridden below, if /etc/iiab/iiab.env is legit
if [ -f /etc/iiab/iiab.env ]; then
source /etc/iiab/iiab.env
fi
Start=`date`
ansible-playbook -i ansible_hosts iiab-network.yml --connection=local
End=`date`
2017-12-07 23:48:35 +00:00
echo "" >> iiab-network.log
# redhat path
2017-12-07 22:56:25 +00:00
if [ "OS" == "centos" ] || [ "OS" == "fedora" ]; then
2017-12-07 23:48:35 +00:00
ls -la /etc/sys*/net*/ifcfg* >> iiab-network.log
fi
2017-12-07 23:48:35 +00:00
# Ubuntu desktop might be using NM - split out.
if [ $(which nmcli) ]; then
2017-12-07 23:48:35 +00:00
nmcli d >> iiab-network.log
nmcli c >> iiab-network.log
fi
echo "" >> iiab-network.log
ip r >> iiab-network.log
echo "" >> iiab-network.log
2017-12-07 23:19:19 +00:00
brctl show >> iiab-network.log
echo "run start: $Start" >> iiab-network.log
echo "run end: $End" >> iiab-network.log
echo "" >> iiab-network.log
echo "" >> iiab-network.log
2017-12-07 23:48:35 +00:00
2017-12-07 23:54:10 +00:00
# Put the same stuff on screen, for live operator
ip r
2017-12-07 23:19:19 +00:00
brctl show
2017-12-07 23:52:59 +00:00
echo "run start: $Start"
echo "run end: $End"