docker-entrypoint.sh 409 B

12345678910111213141516
  1. #!/bin/sh
  2. #set -e
  3. if [ -z ${vip} ]; then echo "IP isn't defined!!!"; exit 1; fi
  4. if [ -z ${vin} ]; then echo "NetMASK isn't defined!!!"; exit 1; fi
  5. if [ -z ${vif} ]; then echo "IF isn't defined!!!"; exit 1; fi
  6. trap cleanup SIGTERM EXIT
  7. cleanup()
  8. {
  9. ip addr del ${vip}/${vin} dev ${vif}:vip
  10. }
  11. ip addr add ${vip}/${vin} brd + dev ${vif} label ${vif}:vip
  12. exec "/tmp/check_ip.sh" "$@" &
  13. wait