root/trunk/engine/setup/set-engine-permissions.sh

Revision 1403, 3.7 kB (checked in by scitech, 1 week ago)

message_size_limit is set twice

  • Property svn:executable set to *
Line 
1 #!/bin/bash
2
3 # ispCP ω (OMEGA) a Virtual Hosting Control Panel
4 # Copyright (c) 2001-2006 by moleSoftware GmbH
5 # http://www.molesoftware.com
6 # Copyright (c) 2006-2008 by isp Control Panel
7 # http://isp-control.net
8 #
9 #
10 # License:
11 #    This program is free software; you can redistribute it and/or
12 #    modify it under the terms of the MPL Mozilla Public License
13 #    as published by the Free Software Foundation; either version 1.1
14 #    of the License, or (at your option) any later version.
15 #
16 #    This program is distributed in the hope that it will be useful,
17 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
18 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 #    MPL Mozilla Public License for more details.
20 #
21 #    You may have received a copy of the MPL Mozilla Public License
22 #    along with this program.
23 #
24 #    An on-line copy of the MPL Mozilla Public License can be found
25 #    http://www.mozilla.org/MPL/MPL-1.1.html
26 #
27 #
28 # The ispCP ω Home Page is at:
29 #
30 #    http://isp-control.net
31 #
32
33 # read needed entries from ispcp.conf
34 if [ -f /usr/local/etc/ispcp/ispcp.conf ]
35 then
36         for a in `cat /usr/local/etc/ispcp/ispcp.conf | grep -E '(APACHE_|ROOT_|MTA_MAILBOX_|^LOG_DIR|^DEBUG|^PHP_STARTER_DIR)' | sed -e 's/ //g'`; do
37                 export $a
38         done
39 else
40         for a in `cat /etc/ispcp/ispcp.conf | grep -E '(APACHE_|ROOT_|MTA_MAILBOX_|^LOG_DIR|^DEBUG|^PHP_STARTER_DIR)' | sed -e 's/ //g'`; do
41                 export $a
42         done
43 fi
44
45 #
46 # fixing engine permissions;
47 #
48
49 echo -n "       Setting Engine Permissions: ";
50
51 if [ $DEBUG -eq 1 ]; then
52     echo        "";
53 fi
54
55 # Fix ispcp.conf perms
56 if [ $DEBUG -eq 1 ]; then
57     echo -e "   ug+r,u+w,o-r $ROOT_USER:$APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID /etc/ispcp/ispcp.conf";
58 else
59     echo -n ".";
60 fi
61
62 if [ -f /usr/local/etc/ispcp/ispcp.conf ]
63 then
64         chown $ROOT_USER:$APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID /usr/local/etc/ispcp/ispcp.conf
65 else
66         chown $ROOT_USER:$APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID /etc/ispcp/ispcp.conf
67 fi
68
69 # Fix rkhunter.log perms
70 if [ $DEBUG -eq 1 ]; then
71     echo -e "   ug+r,u+w,o-r $APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID:$ROOT_USER /var/log/rkhunter.log";
72 else
73     echo -n ".";
74 fi
75
76 #chmod ug+r,u+w,o-r rkhunter.log
77 if [ -f /var/log/rkhunter.log ]
78 then
79         chown $APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID:$ROOT_USER /var/log/rkhunter.log
80 fi
81
82 for i in `find $ROOT_DIR/engine/`; do
83
84         if [ -f $i ]; then
85
86                 if [ $DEBUG -eq 1 ]; then
87                         echo -e "       0700 $ROOT_USER:$ROOT_GROUP $i";
88                 fi
89
90                 chmod 0700 $i;
91                 chown $ROOT_USER:$ROOT_GROUP $i;
92
93         elif [ -d $i ]; then
94
95                 if [ $DEBUG -eq 1 ]; then
96                         echo "0700 $ROOT_USER:$ROOT_GROUP [$i]";
97                 else
98                         echo -n ".";
99                 fi
100
101                 chmod 0700 $i;
102                 chown $ROOT_USER:$ROOT_GROUP $i;
103         fi
104
105 done
106
107 #
108 # fixing engine folder permissions;
109 #
110
111         chmod 0755 $ROOT_DIR/engine;
112         chown $ROOT_USER:$ROOT_GROUP $ROOT_DIR/engine;
113
114 #
115 # fixing fcgi folder permissions in Centos;
116 #
117
118         chmod 0755 $PHP_STARTER_DIR/master;
119         chown $APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID:$APACHE_SUEXEC_USER_PREF$APACHE_SUEXEC_MIN_UID $PHP_STARTER_DIR/master;
120
121 #
122 # fixing messager permissions;
123 #
124
125 i="$ROOT_DIR/engine/messager"
126
127 if [ $DEBUG -eq 1 ]; then
128         echo "0700 $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME [$i]";
129 else
130         echo -n ".";
131 fi
132
133                 chmod -R 0700 $i;
134                 chown -R $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME $i;
135
136
137 #
138 # fixing messager folder permissions;
139 #
140
141 i="$ROOT_DIR/engine/messager"
142
143 if [ $DEBUG -eq 1 ]; then
144         echo "0755 $ROOT_USER:$ROOT_GROUP folder [$i]";
145 else
146         echo -n ".";
147 fi
148
149
150                 chmod 0755 $i;
151                 chown $ROOT_USER:$ROOT_GROUP $i;
152
153
154 #
155 # fixing messager log folder permissions;
156 #
157
158 i="${LOG_DIR}/ispcp-arpl-msgr"
159
160 if [ $DEBUG -eq 1 ]; then
161         echo "0755 $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME folder [$i]";
162 else
163         echo -n ".";
164 fi
165
166                 chmod 0755 $i;
167                 chown -R $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME $i;
168
169 echo "done";
Note: See TracBrowser for help on using the browser.