|
@@ -0,0 +1,17 @@
|
|
|
|
+#!/bin/sh
|
|
|
|
+#set -e
|
|
|
|
+
|
|
|
|
+if [ -z ${service} ]; then echo "The service isn't defined!!!"; exit 1; fi
|
|
|
|
+if [ -z ${floating_ip} ]; then echo "IP isn't defined!!!"; exit 1; fi
|
|
|
|
+if [ -z ${floating_mask} ]; then echo "NetMASK isn't defined!!!"; exit 1; fi
|
|
|
|
+if [ -z ${floating_if} ]; then echo "IF isn't defined!!!"; exit 1; fi
|
|
|
|
+
|
|
|
|
+trap cleanup SIGTERM EXIT
|
|
|
|
+ cleanup()
|
|
|
|
+ {
|
|
|
|
+ ip addr del ${floating_ip}/${floating_mask} dev ${floating_if}:floating
|
|
|
|
+ }
|
|
|
|
+ ip addr add ${floating_ip}/${floating_mask} brd + dev ${floating_if} label ${floating}:floating
|
|
|
|
+exec "/tmp/check_ip.sh" "$@" &
|
|
|
|
+wait
|
|
|
|
+
|