]>
Commit | Line | Data |
---|---|---|
c764ad97 MT |
1 | #!/bin/sh\r |
2 | #\r | |
3 | # $Id: setreservedports,v 1.1.2.3 2005/09/07 21:38:50 eoberlander Exp $\r | |
4 | # Change https server port only at this time,\r | |
5 | # it will be integrate in web interface later\r | |
6 | # suggested port for https interface could be 5445\r | |
7 | \r | |
8 | SSH=222\r | |
9 | \r | |
10 | if [ $# -lt 1 ]; then\r | |
11 | echo "Give an https port number, recommended value is non-assigned port 5445"\r | |
12 | else\r | |
13 | if [ "$1" -lt "445" -o "$1" -gt "65535" ]; then\r | |
14 | echo "support only a port value from 445 to 65535"\r | |
15 | echo "recommended value is non-assigned port 5445"\r | |
16 | else\r | |
17 | HTTPS=$1\r | |
18 | /bin/sed -i -e "s+# TCP 67,68,81.*$+# TCP 67,68,81,$SSH,$HTTPS+" \\r | |
19 | -e "s+my @tcp_reserved = (81.*$+my @tcp_reserved = (81,$SSH,$HTTPS);+" \\r | |
20 | /home/httpd/cgi-bin/portfw.cgi\r | |
21 | \r | |
22 | # only the second Listen only has {3,5} digits if the first is 81\r | |
23 | /bin/sed -i -e "+s+Listen [0-9]\{3,5\}$+Listen $HTTPS+" \\r | |
24 | -e "s+<VirtualHost _default_.*$+<VirtualHost _default_:$HTTPS>+" \\r | |
25 | /etc/httpd/conf/httpd.conf\r | |
26 | \r | |
27 | /bin/sed -i -e "s+:[0-9]\{3,5\}/\$ENV{'PATH_INFO'}+:$HTTPS/\$ENV{'PATH_INFO'}+" \\r | |
28 | /var/ipcop/header.pl\r | |
29 | \r | |
30 | /bin/sed -i -e "s+acl IPFire_https port.*$+acl IPCop_https port $HTTPS+" \\r | |
31 | /var/ipcop/proxy/acl\r | |
32 | /bin/chown nobody:nobody /var/ipcop/proxy/acl\r | |
33 | \r | |
34 | /bin/sed -i -e "s+acl IPFire_https port.*$+acl IPCop_https port $HTTPS+" \\r | |
35 | /var/ipcop/proxy/squid.conf\r | |
36 | /bin/chown nobody:nobody /var/ipcop/proxy/squid.conf\r | |
37 | \r | |
38 | # restart everything impacted\r | |
39 | /bin/killall httpd\r | |
40 | sleep 2\r | |
41 | /usr/sbin/httpd\r | |
42 | /usr/local/bin/restartsquid\r | |
43 | /usr/bin/logger -s -p local0.info "$0 :https port shift to $HTTPS"\r | |
44 | fi\r | |
45 | fi\r |