Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
ipw
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2015-03-31 15:49:06 +0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
6810559d4c3c79c81f3e08bddb00c26a45d79041
6810559d
2 parents
8d65c094
3a59360b
Merge branch 'master' of
https://gitlab.ut.mephi.ru/ut/ipw
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
4 deletions
ipw
ipw
View file @
6810559
...
...
@@ -22,6 +22,14 @@ DEFAULT_BONDING_MODE='balance-tlb'
modprobe bonding
if
lockfile-check /run/ipw;
then
eerror
'Another "ipw" instance is already running'
exit
-1
fi
trap
'lockfile-remove /run/ipw'
SIGINT SIGTERM SIGHUP SIGQUIT SIGALRM SIGILL SIGABRT SIGPIPE EXIT
lockfile-create /run/ipw
||
exit
eerror
()
{
echo
"
$@
"
>&2
}
...
...
@@ -156,8 +164,16 @@ ip_cmds() {
ip addr flush dev
"
$_IFACE
"
for
IP_CMD
in
"
${
!IP_CMDS_VARIABLE
}
"
;
do
[[
"
$IP_CMD
"
!
=
""
]]
&&
ip
$IP_CMD
dev
"
$_IFACE
"
if
[[
"
$IP_CMD
"
!
=
""
]]
;
then
WORDS
=(
$IP_CMD
)
case
"
${
WORDS
[0]
}
"
in
link
)
ip
$IP_CMD
;;
*
)
ip
$IP_CMD
dev
"
$_IFACE
"
esac
fi
done
}
...
...
@@ -331,6 +347,17 @@ case "$CMD" in
fix
)
#fix all interfaces to config state
#brctl addif bond0 eth2
if
[[
"
$IPW_DEBUG
"
-ge
"2"
]]
;
then
cat
"
$IPW_CONFIG_PATH
"
> /tmp/ipw.conf-fix.
$(
date +
'%Y%m%d%H%M%S'
)
fi
if
[[
"
$IPW_CONFIG_PATH
"
!
=
"/dev/null"
]]
;
then
if
[[
"
$(
cat
$IPW_CONFIG_PATH
2>/dev/null
)
"
=
""
]]
;
then
eerror
"Empty config file"
exit
-1
fi
fi
#GETTING INFORMATION ABOUT LXC INTERFACES IN BRIDGES
if
[[
"
$LXC_DIR
"
!
=
""
]]
;
then
...
...
@@ -506,8 +533,11 @@ case "$CMD" in
# Creating bond-ifaces
if
[[
"
$D1Q_EXISTS
"
==
0
]]
;
then
#make all
echo
"+
$D1Q_IFACE
"
> /sys/class/net/bonding_masters
echo
"
$MODE
"
> /sys/class/net/
"
$D1Q_IFACE
"
/bonding/mode
echo
"+
$D1Q_IFACE
"
> /sys/class/net/bonding_masters 2>/dev/null
if
[[
-d /sys/class/net/
"
$D1Q_IFACE
"
/bonding
]]
;
then
echo
"
$MODE
"
> /sys/class/net/
"
$D1Q_IFACE
"
/bonding/mode
fi
for
SLAVE
in
"
${
!SLAVES_VARIABLE
}
"
;
do
ip link
set
dev
"
$SLAVE
"
down
#enslaved int should be shutted down
...
...
Please
register
or
login
to post a comment