Use `grep` because `sed` outputs entire file

master
BrainwreckedTech 2 years ago
parent c1c1447d68
commit d5322a5bd4

@ -26,8 +26,9 @@ case "${1}" in
;; ;;
esac esac
for OPTION in PasswordAuthentication ChallengeResponseAuthentication; do for OPTION in PasswordAuthentication KbdInteractiveAuthentication ChallengeResponseAuthentication; do
sed -i "s/#* *${OPTION} *${FROM}/${OPTION} ${TO}/g; w /dev/stdout" /etc/ssh/sshd_config sed -i "s/#* *${OPTION} *${FROM}/${OPTION} ${TO}/g" /etc/ssh/sshd_config
grep "^#* *${OPTION} *\(yes\|no\)" /etc/ssh/sshd_config
done done
if command -v systemctl > /dev/null; then if command -v systemctl > /dev/null; then

Loading…
Cancel
Save