| 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-2007 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 | # for activating debug, please set to 1; |
|---|
| 34 | DEBUG=0 |
|---|
| 35 | |
|---|
| 36 | # read needed entries from ispcp.conf |
|---|
| 37 | for a in `cat /etc/ispcp/ispcp.conf | grep -E '(ROOT_DIR|MTA_MAILBOX_|^LOG_DIR)' | sed -e 's/ //g'`; do |
|---|
| 38 | export $a |
|---|
| 39 | done |
|---|
| 40 | |
|---|
| 41 | # |
|---|
| 42 | # fixing engine permissions; |
|---|
| 43 | # |
|---|
| 44 | |
|---|
| 45 | echo -n " Setting Engine Permissions: "; |
|---|
| 46 | |
|---|
| 47 | if [ $DEBUG -eq 1 ]; then |
|---|
| 48 | echo ""; |
|---|
| 49 | fi |
|---|
| 50 | |
|---|
| 51 | # Fix ispcp.conf perms |
|---|
| 52 | if [ $DEBUG -eq 1 ]; then |
|---|
| 53 | echo -e "\tug+r,u+w,o-r root:vu2000 /etc/ispcp/ispcp.conf"; |
|---|
| 54 | else |
|---|
| 55 | echo -n "."; |
|---|
| 56 | fi |
|---|
| 57 | |
|---|
| 58 | #chmod ug+r,u+w,o-r /etc/ispcp/ispcp.conf |
|---|
| 59 | chown root:vu2000 /etc/ispcp/ispcp.conf |
|---|
| 60 | |
|---|
| 61 | for i in `find $ROOT_DIR/engine/`; do |
|---|
| 62 | |
|---|
| 63 | if [[ -f $i ]]; then |
|---|
| 64 | |
|---|
| 65 | if [ $DEBUG -eq 1 ]; then |
|---|
| 66 | echo -e "\t0700 root:root $i"; |
|---|
| 67 | fi |
|---|
| 68 | |
|---|
| 69 | chmod 0700 $i; |
|---|
| 70 | chown root:root $i; |
|---|
| 71 | |
|---|
| 72 | elif [[ -d $i ]]; then |
|---|
| 73 | |
|---|
| 74 | if [ $DEBUG -eq 1 ]; then |
|---|
| 75 | echo "0700 root:root [$i]"; |
|---|
| 76 | else |
|---|
| 77 | echo -n "."; |
|---|
| 78 | fi |
|---|
| 79 | |
|---|
| 80 | chmod 0700 $i; |
|---|
| 81 | chown root:root $i; |
|---|
| 82 | fi |
|---|
| 83 | |
|---|
| 84 | done |
|---|
| 85 | |
|---|
| 86 | # |
|---|
| 87 | # fixing engine folder permissions; |
|---|
| 88 | # |
|---|
| 89 | |
|---|
| 90 | chmod 0755 $ROOT_DIR/engine; |
|---|
| 91 | chown root:root $ROOT_DIR/engine; |
|---|
| 92 | |
|---|
| 93 | # |
|---|
| 94 | # fixing messager permissions; |
|---|
| 95 | # |
|---|
| 96 | |
|---|
| 97 | i="$ROOT_DIR/engine/messager" |
|---|
| 98 | |
|---|
| 99 | if [ $DEBUG -eq 1 ]; then |
|---|
| 100 | echo "0700 $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME [$i]"; |
|---|
| 101 | else |
|---|
| 102 | echo -n "."; |
|---|
| 103 | fi |
|---|
| 104 | |
|---|
| 105 | chmod -R 0700 $i; |
|---|
| 106 | chown -R $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME $i; |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | # |
|---|
| 110 | # fixing messager folder permissions; |
|---|
| 111 | # |
|---|
| 112 | |
|---|
| 113 | i="$ROOT_DIR/engine/messager" |
|---|
| 114 | |
|---|
| 115 | if [ $DEBUG -eq 1 ]; then |
|---|
| 116 | echo "0755 root:root folder [$i]"; |
|---|
| 117 | else |
|---|
| 118 | echo -n "."; |
|---|
| 119 | fi |
|---|
| 120 | |
|---|
| 121 | |
|---|
| 122 | chmod 0755 $i; |
|---|
| 123 | chown root:root $i; |
|---|
| 124 | |
|---|
| 125 | |
|---|
| 126 | # |
|---|
| 127 | # fixing messager log folder permissions; |
|---|
| 128 | # |
|---|
| 129 | |
|---|
| 130 | i="${LOG_DIR}/ispcp-arpl-msgr" |
|---|
| 131 | |
|---|
| 132 | if [ $DEBUG -eq 1 ]; then |
|---|
| 133 | echo "0755 $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME folder [$i]"; |
|---|
| 134 | else |
|---|
| 135 | echo -n "."; |
|---|
| 136 | fi |
|---|
| 137 | |
|---|
| 138 | chmod 0755 $i; |
|---|
| 139 | chown -R $MTA_MAILBOX_UID_NAME:$MTA_MAILBOX_GID_NAME $i; |
|---|
| 140 | |
|---|
| 141 | echo "done"; |
|---|