4 # first arg is `-f` or `--some-option`
5 if [ "${1#-}" != "$1" ]; then
9 NAMESERVER_IP=$(cat /etc/resolv.conf | grep 'nameserver' | head -1 | awk '{ print $2; }');
11 sed -i 's/${ONAP_NAMESERVER_CLUSTER_IP}/'${NAMESERVER_IP}'/g' /usr/local/etc/haproxy/resolvers.conf || {
12 echo "Unable to overwrite the nameserver in the haproxy configuration file";
16 if [ "$1" = 'haproxy' ]; then
17 # if the user wants "haproxy", let's use "haproxy-systemd-wrapper" instead so we can have proper reloadability implemented by upstream
19 set -- "$(which haproxy-systemd-wrapper)" -p /run/haproxy.pid "$@"