Author: arkurth
Date: Tue Aug 11 18:15:06 2015
New Revision: 1695344
URL: http://svn.apache.org/r1695344
Log:
VCL-893
Updated section of cygwin-sshd-config.sh which configures the firewall. It now
defaults to use the newer netsh command if the Windows version is greater than
5.x.
Modified:
vcl/trunk/managementnode/bin/cygwin-sshd-config.sh
Modified: vcl/trunk/managementnode/bin/cygwin-sshd-config.sh
URL:
http://svn.apache.org/viewvc/vcl/trunk/managementnode/bin/cygwin-sshd-config.sh?rev=1695344&r1=1695343&r2=1695344&view=diff
==============================================================================
--- vcl/trunk/managementnode/bin/cygwin-sshd-config.sh (original)
+++ vcl/trunk/managementnode/bin/cygwin-sshd-config.sh Tue Aug 11 18:15:06 2015
@@ -319,17 +319,17 @@ print_hr
# Get the Windows version
WINDOWS_VERSION=`/cygdrive/c/Windows/system32/cmd.exe /c ver`
-[[ $WINDOWS_VERSION =~ ([0-9\.]+) ]]
-WINDOWS_VERSION=${BASH_REMATCH[0]}
+[[ $WINDOWS_VERSION =~ ([0-9]+)\. ]]
+WINDOWS_VERSION=${BASH_REMATCH[1]}
echo Windows version: $WINDOWS_VERSION
# Create firewall exception for sshd TCP port 22 traffic
-if [[ $WINDOWS_VERSION =~ ^6\. ]]; then
- echo Configuring sshd firewall port 22 exception for Windows 6.x
+if [ $WINDOWS_VERSION -gt 5 ]; then
+ echo Configuring sshd firewall port 22 exception for Windows 6.x and
later
netsh.exe advfirewall firewall delete rule name=all dir=in protocol=TCP
localport=22
netsh.exe advfirewall firewall add rule name="VCL: allow SSH port 22
from any address" description="Allows incoming SSH (TCP port 22) traffic from
any address" protocol=TCP localport=22 action=allow enable=yes dir=in
localip=any remoteip=any
else
- echo Configuring sshd firewall port 22 exception for Windows 5.x
+ echo Configuring sshd firewall port 22 exception for Windows 5.x and
earlier
netsh.exe firewall set portopening name = "Cygwin SSHD" protocol = TCP
port = 22 mode = ENABLE profile = ALL scope = ALL
fi