Use grep because sed outputs entire file

This commit is contained in:
BrainwreckedTech committed 2022-11-14 01:03:42 -05:00
1 parent c1c1447d68
commit d5322a5bd4
1 file changed
+3 -2
+3 -2
View File
@@ -26,8 +26,9 @@ case "${1}" in
;;
esac
for OPTION in PasswordAuthentication ChallengeResponseAuthentication; do
sed -i "s/#* *${OPTION} *${FROM}/${OPTION} ${TO}/g; w /dev/stdout" /etc/ssh/sshd_config
for OPTION in PasswordAuthentication KbdInteractiveAuthentication ChallengeResponseAuthentication; do
sed -i "s/#* *${OPTION} *${FROM}/${OPTION} ${TO}/g" /etc/ssh/sshd_config
grep "^#* *${OPTION} *\(yes\|no\)" /etc/ssh/sshd_config
done
if command -v systemctl > /dev/null; then