ip-request
来自「linux集群服务器软件代码包」· 代码 · 共 81 行
TXT
81 行
#!/bin/sh## This script is called to "give up" an IP address when requested## It could be that we don't have it, in which case we ignore the request.### Note: this script is called by the heartbeat code, so it gets# most of its arguments through the environment.#. $HA_FUNCSIFCONFIG=/sbin/ifconfigROUTE=/sbin/routeRSCMGR=$HA_BIN/ResourceManager### Really a resource group name...case "$HA_ipaddr" in ?*) false;; *) cat <<-!EOF $0 will give up the specified IP address if we have it assigned to us. Otherwise it will do nothing. $0 was invoked with these arguments: $* And this is the HA_ environment: !EOF env | grep '^HA_' exit 1;;esac## HA_t, HA_src, and HA_ipaddr are fields the sender put in the message#CMD=$HA_tORIGNODE=$HA_srcIPADDR=$HA_ipaddrif [ "X$ORIGNODE" = "X$HA_CURHOST" ]then exit 0; # request is from us!fi# # Ignore this request if we don't own this resource#if $RSCMGR status $IPADDRthen weown=yes if [ -x $HA_RCDIR/local_giveip ] then $HA_RCDIR/local_giveip $* fi $RSCMGR givegroup $IPADDRelse weown=nofi## Now give our ip-request-response message...#ha_clustermsg <<!MSGt=$CMD-respdest=$ORIGNODEipaddr=$IPADDRweown=$weownok=OK!MSG
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?