mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
make both check lines consistent
No need to make a variable, use it on one place and hardcode it on another.
This commit is contained in:
parent
525949e027
commit
8fb677027d
@ -17,14 +17,13 @@
|
||||
# under the License.
|
||||
|
||||
STATUS=UNKNOWN
|
||||
INTERFACE=eth1
|
||||
ROUTER_TYPE=$(cat /etc/cloudstack/cmdline.json | grep type | awk '{print $2;}' | sed -e 's/[,\"]//g')
|
||||
if [ "$ROUTER_TYPE" = "router" ]
|
||||
then
|
||||
ROUTER_STATE=$(ip addr | grep eth0 | grep inet | wc -l | xargs bash -c 'if [ $0 == 2 ]; then echo "MASTER"; else echo "BACKUP"; fi')
|
||||
STATUS=$ROUTER_STATE
|
||||
else
|
||||
ROUTER_STATE=$(ip addr | grep $INTERFACE | grep state | awk '{print $9;}')
|
||||
ROUTER_STATE=$(ip addr | grep eth1 | grep state | awk '{print $9;}')
|
||||
if [ "$ROUTER_STATE" = "UP" ]
|
||||
then
|
||||
STATUS=MASTER
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user