Skip to content

Commit

Permalink
Merge pull request #495 from legal90/fix-sshd-script
Browse files Browse the repository at this point in the history
Fix grep character class syntax in sshd.sh script
  • Loading branch information
Seth Thomas committed Nov 22, 2015
2 parents 0b37583 + f08c1f5 commit f92f1e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/common/sshd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ SSHD_CONFIG="/etc/ssh/sshd_config"
sed -i -e '$a\' "$SSHD_CONFIG"

USEDNS="UseDNS no"
if grep -q -E "^[:space:]*UseDNS" "$SSHD_CONFIG"; then
if grep -q -E "^[[:space:]]*UseDNS" "$SSHD_CONFIG"; then
sed -i "s/^\s*UseDNS.*/${USEDNS}/" "$SSHD_CONFIG"
else
echo "$USEDNS" >>"$SSHD_CONFIG"
fi

GSSAPI="GSSAPIAuthentication no"
if grep -q -E "^[:space:]*GSSAPIAuthentication" "$SSHD_CONFIG"; then
if grep -q -E "^[[:space:]]*GSSAPIAuthentication" "$SSHD_CONFIG"; then
sed -i "s/^\s*GSSAPIAuthentication.*/${GSSAPI}/" "$SSHD_CONFIG"
else
echo "$GSSAPI" >>"$SSHD_CONFIG"
Expand Down

0 comments on commit f92f1e0

Please sign in to comment.