__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#! /bin/sh
# config script for webalizer
#
# see: dh_installdeb(1)
set -e
# bogus - though necessary - rule
. /usr/share/debconf/confmodule
db_version 2.0
case "$1" in
configure|reconfigure)
if [ "$2" ] && dpkg --compare-versions $2 lt 2.01.6-1; then
db_input high webalizer/upgrading || true
db_go
fi
if [ "$2" ] && dpkg --compare-versions $2 lt 2.01.10-30; then
db_input high webalizer/upgrade2011030 || true
db_go
fi
if [ -f "/etc/webalizer.conf" ] && [ ! -f "/etc/webalizer/webalizer.conf" ]; then
[ -d /etc/webalizer/ ] || mkdir /etc/webalizer/;
mv /etc/webalizer.conf /etc/webalizer/webalizer.conf;
fi
conffile="/etc/webalizer/webalizer.conf"
OUTPUTDIR=""
REPORTTITLE=""
LOGFILE=""
if [ -f $conffile ]; then
# parse existing configuration. This code happily
# concatenates multiple occurences of a configuration item,
# but that should never occur <frank@debian.org>.
OUTPUTDIR=`sed -ne '/^OutputDir/ {s@OutputDir[[:space:]]\([^[:space:]]*\)@\1@;p}' $conffile`
REPORTTITLE=`sed -ne '/^ReportTitle/ {s@ReportTitle[[:space:]]\([^[:space:]]*\)@\1@;p}' $conffile`
LOGFILE=`sed -ne '/^LogFile/ {s@LogFile[[:space:]]\([^[:space:]]*\)@\1@;p}' $conffile`
fi
# assign default values
[ -n "$OUTPUTDIR" ] || OUTPUTDIR="/var/www/webalizer"
[ -n "$REPORTTITLE" ] || REPORTTITLE="Usage statistics for"
if [ -z "$LOGFILE" ]; then
# apache2 found?
if [ -f /var/log/apache2/access.log.1 ] || [ -f /var/log/apache2/access.log ]; then
LOGFILE="/var/log/apache2/access.log.1";
else
LOGFILE="/var/log/apache/access.log.1";
fi
fi
# now preseed the debconf questions with what we found
db_set webalizer/directory "$OUTPUTDIR" || true
db_set webalizer/doc_title "$REPORTTITLE" || true
db_set webalizer/logfile "$LOGFILE" || true
# Ask wether we should create the config file
db_input medium webalizer/create_conf || true
db_go
db_get webalizer/create_conf || true
CREATE_CONF="$RET"
if [ "$CREATE_CONF" = "true" ]; then
# Ask for the directory the output should be put in
db_input medium webalizer/directory || true
db_go
# At this point, ask the user what the title of webalizer's reports should be
db_input medium webalizer/doc_title || true
db_go
# Ask for the rotated logfile
# by default is access log file of apache, but if I found apache2 log file,
# I changed default to this one.
db_input medium webalizer/logfile || true
db_go
# Ask for enable DNSCache option
db_input medium webalizer/dnscache || true
db_go
fi
;;
*)
echo "config called with unknown argument \`$1'" >&2;
exit 1;
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0