ingress-nginx-helm/controllers/nginx/rootfs/ingress-controller/clean-nginx-conf.sh
2017-09-07 13:48:36 -03:00

8 lines
274 B
Bash
Executable file

#!/bin/bash
# This script removes consecutive empty lines in nginx.conf
# Using sed is more simple than using a go regex
# first sed removes empty lines
# second sed command replaces the empty lines
sed -e 's/\r//g' | sed -e 's/^ *$/\'$'\n/g' | sed -e '/^$/{N;/^\n$/d;}'