switch tabs to spaces where allowed

This commit is contained in:
diginc
2016-10-30 12:25:08 -05:00
parent cb66d578a5
commit 7325ae336c

View File

@@ -30,36 +30,36 @@ setup_dnsmasq_hostnames() {
local IPv4_address="${1}" local IPv4_address="${1}"
local IPv6_address="${2}" local IPv6_address="${2}"
local hostname="${3}" local hostname="${3}"
local dnsmasq_pihole_01_location="/etc/dnsmasq.d/01-pihole.conf" local dnsmasq_pihole_01_location="/etc/dnsmasq.d/01-pihole.conf"
if [ -z "$hostname" ]; then if [ -z "$hostname" ]; then
if [[ -f /etc/hostname ]]; then if [[ -f /etc/hostname ]]; then
hostname=$(</etc/hostname) hostname=$(</etc/hostname)
elif [ -x "$(command -v hostname)" ]; then elif [ -x "$(command -v hostname)" ]; then
hostname=$(hostname -f) hostname=$(hostname -f)
fi fi
fi; fi;
if [[ "${IPv4_address}" != "" ]]; then if [[ "${IPv4_address}" != "" ]]; then
tmp=${IPv4_address%/*} tmp=${IPv4_address%/*}
sed -i "s/@IPv4@/$tmp/" ${dnsmasq_pihole_01_location} sed -i "s/@IPv4@/$tmp/" ${dnsmasq_pihole_01_location}
else else
sed -i '/^address=\/pi.hole\/@IPv4@/d' ${dnsmasq_pihole_01_location} sed -i '/^address=\/pi.hole\/@IPv4@/d' ${dnsmasq_pihole_01_location}
sed -i '/^address=\/@HOSTNAME@\/@IPv4@/d' ${dnsmasq_pihole_01_location} sed -i '/^address=\/@HOSTNAME@\/@IPv4@/d' ${dnsmasq_pihole_01_location}
fi fi
if [[ "${IPv6_address}" != "" ]]; then if [[ "${IPv6_address}" != "" ]]; then
sed -i "s/@IPv6@/$IPv6_address/" ${dnsmasq_pihole_01_location} sed -i "s/@IPv6@/$IPv6_address/" ${dnsmasq_pihole_01_location}
else else
sed -i '/^address=\/pi.hole\/@IPv6@/d' ${dnsmasq_pihole_01_location} sed -i '/^address=\/pi.hole\/@IPv6@/d' ${dnsmasq_pihole_01_location}
sed -i '/^address=\/@HOSTNAME@\/@IPv6@/d' ${dnsmasq_pihole_01_location} sed -i '/^address=\/@HOSTNAME@\/@IPv6@/d' ${dnsmasq_pihole_01_location}
fi fi
if [[ "${hostname}" != "" ]]; then if [[ "${hostname}" != "" ]]; then
sed -i "s/@HOSTNAME@/$hostname/" ${dnsmasq_pihole_01_location} sed -i "s/@HOSTNAME@/$hostname/" ${dnsmasq_pihole_01_location}
else else
sed -i '/^address=\/@HOSTNAME@*/d' ${dnsmasq_pihole_01_location} sed -i '/^address=\/@HOSTNAME@*/d' ${dnsmasq_pihole_01_location}
fi fi
} }
setup_php_env() { setup_php_env() {
@@ -90,6 +90,7 @@ setup_php_env_debian() {
} }
setup_php_env_alpine() { setup_php_env_alpine() {
# Intentionally tabs, required by HEREDOC de-indentation (<<-)
cat <<-EOF > "$PHP_ENV_CONFIG" cat <<-EOF > "$PHP_ENV_CONFIG"
[www] [www]
env[PATH] = ${PATH} env[PATH] = ${PATH}