Modifs debian sur quelques scripts
This commit is contained in:
parent
04462b0cf3
commit
fcca1511c6
|
@ -6,7 +6,7 @@
|
||||||
echo "Connecting to AlternC MySQL database... "; flush();
|
echo "Connecting to AlternC MySQL database... "; flush();
|
||||||
|
|
||||||
define('NOCHECK', 1);
|
define('NOCHECK', 1);
|
||||||
require_once("/var/alternc/bureau/class/config.php");
|
require_once("/usr/lib/alternc/panel/class/config.php");
|
||||||
|
|
||||||
echo "done.\n";
|
echo "done.\n";
|
||||||
echo "------------------------------------------------------------\n";
|
echo "------------------------------------------------------------\n";
|
||||||
|
@ -35,8 +35,8 @@ if (!$m1 && !$m2 && !$m3 && !$m4 && !$m5) {
|
||||||
$checks=array(
|
$checks=array(
|
||||||
"1" => "Change owner and group of pop mail accounts",
|
"1" => "Change owner and group of pop mail accounts",
|
||||||
"2" => "Change owner and group of html folders",
|
"2" => "Change owner and group of html folders",
|
||||||
"3" => "Remove non-existent pop accounts in /var/alternc/mail",
|
"3" => "Remove non-existent pop accounts in ALTERNC_MAIL",
|
||||||
"4" => "Remove non-existent alternc accounts in /var/alternc/html",
|
"4" => "Remove non-existent alternc accounts in ALTERNC_HTML",
|
||||||
"5" => "Delete subdomains of non-existents folders pointers (dangling links)",
|
"5" => "Delete subdomains of non-existents folders pointers (dangling links)",
|
||||||
"6" => "Delete ftp accounts of non-existents folders",
|
"6" => "Delete ftp accounts of non-existents folders",
|
||||||
"7" => "Delete mailman mailing-lists in mailman alternc table who does not exists anymore in /var/lib/mailman/lists",
|
"7" => "Delete mailman mailing-lists in mailman alternc table who does not exists anymore in /var/lib/mailman/lists",
|
||||||
|
|
|
@ -17,7 +17,7 @@ if ($argc!=2) {
|
||||||
|
|
||||||
$name=$argv[1];
|
$name=$argv[1];
|
||||||
|
|
||||||
include("/var/alternc/bureau/class/local.php");
|
include("/usr/lib/alternc/panel/class/local.php");
|
||||||
|
|
||||||
if (!mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD)) {
|
if (!mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD)) {
|
||||||
echo "Cannot connect to Mysql !\n";
|
echo "Cannot connect to Mysql !\n";
|
||||||
|
|
|
@ -20,13 +20,13 @@ if [ $# -ne 2 ] || [[ ! "$MID" =~ ^[0-9]+$ ]] || [[ ! "$SIZE" =~ ^[0-9]+$ ]]; th
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DATA_PART=`$DF "${ALTERNC_LOC}/html" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
|
DATA_PART=`$DF "${ALTERNC_HTML}" 2>/dev/null | $AWK 'NR==2 { print $1 }'`
|
||||||
|
|
||||||
# quota will give over NFS will print the partition using the full NFS name
|
# quota will give over NFS will print the partition using the full NFS name
|
||||||
# (e.g. 10.0.0.1:/var/alternc) so we need to lookup first with mount
|
# (e.g. 10.0.0.1:/var/alternc) so we need to lookup first with mount
|
||||||
# to convert DATA_PART if needed.
|
# to convert DATA_PART if needed.
|
||||||
|
|
||||||
QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_LOC}/html type nfs.*,\1,p"`
|
QUOTA_PART=`$MOUNT | $SED -n -e "s,\([^ ]*\) on ${ALTERNC_HTML} type nfs.*,\1,p"`
|
||||||
echo $QUOTA_PART
|
echo $QUOTA_PART
|
||||||
|
|
||||||
if [ -z "$QUOTA_PART" ]; then
|
if [ -z "$QUOTA_PART" ]; then
|
||||||
|
|
|
@ -21,7 +21,7 @@ if ($argc!=3) {
|
||||||
$name=$argv[1];
|
$name=$argv[1];
|
||||||
$quota=$argv[2];
|
$quota=$argv[2];
|
||||||
|
|
||||||
include("/var/alternc/bureau/class/local.php");
|
include("/usr/lib/alternc/panel/class/local.php");
|
||||||
|
|
||||||
if (!mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD)) {
|
if (!mysql_connect($L_MYSQL_HOST,$L_MYSQL_LOGIN,$L_MYSQL_PWD)) {
|
||||||
echo "Cannot connect to Mysql !\n";
|
echo "Cannot connect to Mysql !\n";
|
||||||
|
|
|
@ -15,8 +15,7 @@ done
|
||||||
|
|
||||||
LOCK_FILE="/var/run/alternc/update_mails"
|
LOCK_FILE="/var/run/alternc/update_mails"
|
||||||
|
|
||||||
#FIXME: this var should be define by local.sh
|
# ALTERNC_MAIL is from local.sh
|
||||||
ALTERNC_MAIL_LOC="/var/alternc/mail"
|
|
||||||
|
|
||||||
# Somes check before start operations
|
# Somes check before start operations
|
||||||
if [ `id -u` -ne 0 ]; then
|
if [ `id -u` -ne 0 ]; then
|
||||||
|
@ -44,7 +43,7 @@ mysql_query "SELECT id, address_id, quote(replace(path,'!','\\!')) FROM mailbox
|
||||||
mysql_query "UPDATE mailbox set mail_action='DELETING' WHERE id=$id;"
|
mysql_query "UPDATE mailbox set mail_action='DELETING' WHERE id=$id;"
|
||||||
/usr/lib/alternc/mail_dodelete.php "$address_id"
|
/usr/lib/alternc/mail_dodelete.php "$address_id"
|
||||||
# Check there is no instruction of changing directory, and check the first part of the string
|
# Check there is no instruction of changing directory, and check the first part of the string
|
||||||
if [[ "$path" =~ '../' || "$path" =~ '/..' || ! "'$ALTERNC_MAIL_LOC'" == "${path:0:$((${#ALTERNC_MAIL_LOC}+1))}'" ]] ; then
|
if [[ "$path" =~ '../' || "$path" =~ '/..' || ! "'$ALTERNC_MAIL'" == "${path:0:$((${#ALTERNC_MAIL}+1))}'" ]] ; then
|
||||||
# The path will be empty for mailman addresses
|
# The path will be empty for mailman addresses
|
||||||
if [[ "$path" != "''" ]]; then
|
if [[ "$path" != "''" ]]; then
|
||||||
echo "Error : this directory will not be deleted, pattern incorrect"
|
echo "Error : this directory will not be deleted, pattern incorrect"
|
||||||
|
|
Loading…
Reference in New Issue