Changed unneeded 'elif' statements to simple individual 'if' statements

This commit is contained in:
2026-01-01 12:40:03 -05:00
parent 8d3c013539
commit 8b892d207d
4 changed files with 81 additions and 27 deletions

View File

@@ -31,7 +31,9 @@ EOF
systemd-timesyncd \
whois \
zfsutils-linux
elif [[ "${1}" == '--mmdebstrap' ]]; then
fi
if [[ "${1}" == '--mmdebstrap' ]]; then
packages=(\
console-setup \
cryptsetup \
@@ -71,7 +73,9 @@ zstd\
${include} \
"${VERSION_CODENAME}" \
/mnt
elif [[ "${1}" == '--network-interfaces' ]]; then
fi
if [[ "${1}" == '--network-interfaces' ]]; then
networkInterface=($(ip -br addr show | sed 's| .*$||g' | grep -v '^lo' | grep -v 'tailscale' | grep -v '^wg'))
shopt -s extglob
@@ -81,7 +85,9 @@ allow-hotplug ${networkInterface[$i]}
iface ${networkInterface[$i]} inet dhcp
EOF
done
elif [[ "${1}" == '--sources' ]]; then
fi
if [[ "${1}" == '--sources' ]]; then
cat << EOF | tee /mnt/etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^}
Enabled: yes
@@ -109,7 +115,9 @@ Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
EOF
rm /mnt/etc/apt/sources.list
elif [[ "${1}" == '--dpkg-reconfigure' ]]; then
fi
if [[ "${1}" == '--dpkg-reconfigure' ]]; then
cat << EOF
Regardless of the language(s) you choose, be sure to enable 'en_US.UTF-8'!
@@ -123,12 +131,16 @@ EOF
tzdata \
keyboard-configuration \
console-setup
elif [[ "${1}" == '--purge-os-prober' ]]; then
fi
if [[ "${1}" == '--purge-os-prober' ]]; then
apt \
purge \
--yes \
os-prober
elif [[ "${1}" == '--network-manager' ]]; then
fi
if [[ "${1}" == '--network-manager' ]]; then
cp \
/etc/NetworkManager/NetworkManager.conf \
/etc/NetworkManager/NetworkManager.conf.orig
@@ -137,7 +149,9 @@ elif [[ "${1}" == '--network-manager' ]]; then
/etc/NetworkManager/NetworkManager.conf.orig | \
sed 's|managed=false|managed=true|' | \
tee /etc/NetworkManager/NetworkManager.conf &> /dev/null
elif [[ "${1}" == '--contrib' ]]; then
fi
if [[ "${1}" == '--contrib' ]]; then
cat << EOF | tee --append /etc/apt/sources.list.d/${VERSION_CODENAME}.sources &> /dev/null
# ${VERSION_CODENAME^} Backports
@@ -167,7 +181,9 @@ Pin: release n=${VERSION_CODENAME}-backports
Pin-Priority: -1
EOF
fi
elif [[ "${1}" == '--tasksel' ]]; then
fi
if [[ "${1}" == '--tasksel' ]]; then
if [[ ! -f /usr/bin/tasksel ]]; then
apt \
--update \
@@ -178,7 +194,9 @@ elif [[ "${1}" == '--tasksel' ]]; then
tasksel \
--new-install
elif [[ "${1}" == '--initramfs' ]]; then
fi
if [[ "${1}" == '--initramfs' ]]; then
printf \
"UMASK=0077\n" | \
tee /etc/initramfs-tools/conf.d/umask.conf &> /dev/null
@@ -186,13 +204,17 @@ elif [[ "${1}" == '--initramfs' ]]; then
update-initramfs \
-c \
-k all
elif [[ "${1}" == '--logrotate' ]]; then
fi
if [[ "${1}" == '--logrotate' ]]; then
for file in /etc/logrotate.d/* ; do
if grep -Eq "(^|[^#y])compress" "$file" ; then
sed -i -r "s/(^|[^#y])(compress)/\1#\2/" "$file"
fi
done
elif [[ "${1}" == '--systemctl-enable' ]]; then
fi
if [[ "${1}" == '--systemctl-enable' ]]; then
systemctl \
enable \
zfs.target