Skip to content

Commit

Permalink
regex tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschwenn committed Nov 5, 2013
1 parent 282ae46 commit 413b69f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sshport/sshport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ echo "TO 22, JUST ENTER "22" FOR THE PORT NUMBER."
echo "........."
echo "PLEASE ENTER A PORT NUMBER:"
while read port; do
if [[ $port =~ ^[0-9]{2,10}$ ]]; then
if [[ $port =~ ^[0-9]{2,5}$ ]]; then
if [[ $port = 22 ]]; then
sudo /usr/libexec/PlistBuddy -c "Set Sockets:Listeners:SockServiceName ssh" /System/Library/LaunchDaemons/ssh.plist
echo "SYSTEM WILL NOW LISTEN ON DEFAULT PORT 22 FOR SSH"
Expand All @@ -30,7 +30,7 @@ echo "SYSTEM WILL NOW LISTEN ON PORT $port FOR SSH"
break 2
fi
else
echo "INVALID PORT: MUST BE NUMERIC! (2 to 10 digits)"
echo "INVALID PORT: MUST BE NUMERIC! (2 to 5 digits)"
fi
done
#TURN OFF AND TURN BACK ON REMOTE LOGIN
Expand Down

0 comments on commit 413b69f

Please sign in to comment.