mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
Eventscript functions - remove now-unused route/IP re-add script logic
This is no longer used by 13.per_ip_routing or anything else. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit 2a2ea6c61a05af2d0765e964abcc7ef04047431e)
This commit is contained in:
parent
940efdb8e9
commit
0b2c3d7d24
@ -823,30 +823,6 @@ delete_ip_from_iface()
|
||||
return $?
|
||||
}
|
||||
|
||||
setup_iface_ip_readd_script()
|
||||
{
|
||||
local _iface=$1
|
||||
local _ip=$2
|
||||
local _maskbits=$3
|
||||
local _readd_script=$4
|
||||
local _state_dir="$CTDB_VARDIR/state/interface_modify"
|
||||
local _lockfile="$_state_dir/$_iface.flock"
|
||||
local _readd_base="$_state_dir/$_iface.readd.d"
|
||||
|
||||
mkdir -p $_state_dir || {
|
||||
ret=$?
|
||||
echo "Failed to mkdir -p $_state_dir - $ret"
|
||||
return $ret
|
||||
}
|
||||
|
||||
test -f $_lockfile || {
|
||||
touch $_lockfile
|
||||
}
|
||||
|
||||
flock --timeout 30 $_lockfile $CTDB_BASE/interface_modify.sh readd_script "$_iface" "$_ip" "$_maskbits" "$_readd_base" "$_readd_script"
|
||||
return $?
|
||||
}
|
||||
|
||||
########################################################
|
||||
# some simple logic for counting events - per eventscript
|
||||
# usage: ctdb_counter_init
|
||||
|
@ -62,23 +62,6 @@ delete_ip_from_iface()
|
||||
echo "re-adding secondary address $_i to dev $_iface"
|
||||
ip addr add $_i brd + dev $_iface || _failed=1
|
||||
fi
|
||||
local _s_ip=`echo "$_i" | cut -d '/' -f1`
|
||||
local _s_maskbits=`echo "$_i" | cut -d '/' -f2`
|
||||
local _s_script_dir="$_readd_base/$_s_ip.$_s_maskbits"
|
||||
|
||||
local _s_script=""
|
||||
for _s_script in $_s_script_dir/*; do
|
||||
test -x "$_s_script" || {
|
||||
continue
|
||||
}
|
||||
echo "call $_s_script '$_iface' '$_s_ip' '$_s_maskbits'"
|
||||
$_s_script "$_iface" "$_s_ip" "$_s_maskbits" || {
|
||||
ret=$?
|
||||
echo "$_s_script '$_iface' '$_s_ip' '$_s_maskbits' - failed - $ret"
|
||||
_failed=1
|
||||
}
|
||||
done
|
||||
|
||||
done
|
||||
}
|
||||
|
||||
@ -93,36 +76,6 @@ delete_ip_from_iface()
|
||||
return 0;
|
||||
}
|
||||
|
||||
setup_iface_ip_readd_script()
|
||||
{
|
||||
local _iface=$1
|
||||
local _ip=$2
|
||||
local _maskbits=$3
|
||||
local _readd_base=$4
|
||||
local _readd_script=$5
|
||||
local _script_dir="$_readd_base/$_ip.$_maskbits"
|
||||
|
||||
test -x "$_readd_script" || {
|
||||
echo "Script '$_readd_script' isn't executable"
|
||||
return 1;
|
||||
}
|
||||
|
||||
local _readd_basename=`basename $_readd_script`
|
||||
local _readd_final="$_script_dir/$_readd_basename"
|
||||
|
||||
mkdir -p $_script_dir || {
|
||||
echo "Failed to mkdir -p $_script_dir"
|
||||
return 1;
|
||||
}
|
||||
|
||||
cp -a $_readd_script $_readd_final || {
|
||||
echo "Failed to - cp -a $_readd_script $_readd_final"
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
case "$OP" in
|
||||
add)
|
||||
add_ip_to_iface $IFACE $IP $MASKBITS $READD_BASE
|
||||
@ -132,10 +85,6 @@ case "$OP" in
|
||||
delete_ip_from_iface $IFACE $IP $MASKBITS $READD_BASE
|
||||
exit $?
|
||||
;;
|
||||
readd_script)
|
||||
setup_iface_ip_readd_script $IFACE $IP $MASKBITS $READD_BASE $READD_SCRIPT
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "$0: unknown operation[$OP]"
|
||||
|
Loading…
Reference in New Issue
Block a user