Skip to content

Commit

Permalink
Fix grep character class syntax in sshd.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed Nov 22, 2015
1 parent 0b37583 commit f08c1f5
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 f08c1f5

Please sign in to comment.