From 2448ceae550151d5c6df0bdba2bd1f1611a03890 Mon Sep 17 00:00:00 2001 From: Axel ROGER Date: Thu, 4 Oct 2012 13:48:53 +0000 Subject: [PATCH] =?UTF-8?q?Script=20qui=20existait=20d=C3=A9j=C3=A0...=20z?= =?UTF-8?q?omg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 - awstats/awstatsconfregenerate.sh | 44 -------------------------------- 2 files changed, 45 deletions(-) delete mode 100755 awstats/awstatsconfregenerate.sh diff --git a/.gitattributes b/.gitattributes index 0a2cf22b..c15ce12f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -21,7 +21,6 @@ awstats/awstats.cache.php -text awstats/awstats.sql -text awstats/awstats.template.conf -text awstats/awstats_alternc.png -text -awstats/awstatsconfregenerate.sh -text awstats/bureau/admin/aws_add.php -text awstats/bureau/admin/aws_del.php -text awstats/bureau/admin/aws_doadd.php -text diff --git a/awstats/awstatsconfregenerate.sh b/awstats/awstatsconfregenerate.sh deleted file mode 100755 index 9df02926..00000000 --- a/awstats/awstatsconfregenerate.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Awstats configuration files regeneration by Axel -# Delete old stats configuration files, and -# regenerate them from the database with the new template! - -CONFIG_FILE="/usr/lib/alternc/functions.sh" -TEMPLATE="/etc/alternc/templates/awstats/awstats.template.conf" -DIR_TARGET="/etc/awstats" -TMP_FILE=$(mktemp "/tmp/awstats_conf.XXXXXX") - -if [ ! -r "$CONFIG_FILE" ]; then - echo "Can't access $CONFIG_FILE." - exit 1 -fi -. "$CONFIG_FILE" - -# Delete old stats configuration files -rm "$DIR_TARGET"/awstats.*.conf - -$MYSQL_DO "SELECT id, hostname, public, hostaliases FROM aws;" | while read id hostname public hostaliases ; do - cp "$TEMPLATE" "$TMP_FILE" - users="" - $MYSQL_DO "SELECT login FROM aws_access WHERE id=$id;" | (while read login ; do - users="$users$login " - done - - # Put the good value in the conf file - sed -i \ - -e "s#%%HOSTNAME%%#$hostname#g" \ - -e "s#%%PUBLIC%%#$public#g" \ - -e "s#%%HOSTALIASES%%#$hostaliases#g" \ - -e "s#%%USERS%%#$users#g" \ - "$TMP_FILE") - - # Set conf file with good rights - # And put it in prod - cp -f "$TMP_FILE" "$DIR_TARGET/awstats.$hostname.conf" - chmod 644 "$DIR_TARGET/awstats.$hostname.conf" - chown alterncpanel:alterncpanel "$DIR_TARGET/awstats.$hostname.conf" -done - -# Remove temporary file -rm "$TMP_FILE"