code refactoring (#845)

This commit is contained in:
tteckster 2022-12-19 11:08:29 -05:00 committed by GitHub
parent 9507f9df5c
commit 13ac5e607f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
58 changed files with 116 additions and 232 deletions

View file

@ -107,9 +107,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -363,9 +363,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -116,9 +116,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -122,9 +122,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -109,9 +109,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -140,9 +140,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -101,9 +101,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -133,9 +133,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -159,9 +159,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -122,9 +122,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -107,9 +107,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -129,9 +129,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -116,9 +116,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi
systemctl start grafana-server

View file

@ -145,9 +145,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -140,9 +140,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -185,9 +185,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -343,9 +343,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -119,9 +119,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -137,9 +137,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -140,9 +140,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -107,9 +107,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -147,9 +147,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -128,9 +128,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -224,9 +224,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -124,9 +124,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -118,9 +118,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -137,9 +137,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -114,9 +114,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -130,9 +130,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -156,9 +156,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -105,9 +105,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -262,9 +262,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -136,9 +136,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -138,9 +138,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -112,9 +112,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -124,9 +124,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -124,9 +124,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -197,9 +197,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -127,9 +127,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -126,9 +126,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -160,9 +160,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -231,9 +231,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -136,9 +136,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -195,9 +195,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -165,9 +165,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -110,9 +110,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -107,9 +107,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -131,9 +131,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -102,9 +102,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -117,9 +117,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi
msg_info "Cleaning up"

View file

@ -115,9 +115,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -136,9 +136,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -192,9 +192,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -124,9 +124,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -152,9 +152,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -166,9 +166,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -152,9 +152,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi

View file

@ -128,9 +128,7 @@ EOF
msg_ok "Customized Container"
fi
if [[ "${SSH_ROOT}" == "yes" ]]; then
cat <<EOF >>/etc/ssh/sshd_config
PermitRootLogin yes
EOF
sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
systemctl restart sshd
fi