Commit 63f2b577 authored by Benjamin Sonntag's avatar Benjamin Sonntag

fixing SUDO + adding 'upgrade' in alternc.install for alternc-mailman + adding...

fixing SUDO + adding 'upgrade' in alternc.install for alternc-mailman + adding COLOR in alternc.install and postinst
parent 60cadfaf
......@@ -44,6 +44,8 @@ install-common:
test -d $(DESTDIR)/etc || mkdir -p $(DESTDIR)/etc
cp -r etc/alternc $(DESTDIR)/etc
cp -r etc/incron.d $(DESTDIR)/etc
install -o root -g root -m 440 etc/sudoers.d/alternc $(DESTDIR)/etc/sudoers.d
# SVN cleanup (bad if installing without DESTDIR, FIXME)
find $(DESTDIR)/etc/ -depth -type d -name ".svn" -exec rm {} -rf \;
chmod 755 $(DESTDIR)/etc/alternc etc/incron.d
......
etc/sudoers.d
etc/alternc
etc/alternc/apache-panel.d
etc/alternc/templates
......
......@@ -251,42 +251,19 @@ EOF
# Apache will not start without this file
touch /var/lib/alternc/apache-vhost/vhosts_all.conf
#sudo stuff allowing alterncpanel to use quota
if [ -d /etc/sudoers.d ]; then
cp /etc/alternc/alternc-sudoers /etc/sudoers.d/alternc-sudoers
chmod 0440 /etc/sudoers.d/alternc-sudoers
if ! grep -q '#includedir /etc/sudoers.d' "/etc/sudoers"; then
echo "*************************************************"
echo "* *"
echo "* /!\ WARNING /!\ *"
echo "* Please add yourself the following directive : *"
echo "* #includedir /etc/sudoers.d *"
echo "* in file /etc/sudoers (use visudo command) *"
echo "* Else you'll have troubles with some features *"
echo "* of AlternC *"
echo "* *"
echo "*************************************************"
fi
else
echo "running an older version of sudo"
#FIXME
echo "copy content of /usr/share/doc/examples/example.sudoers into /etc/sudoers.d to run properly"
fi
# important: postinst freezes without that:
db_stop
# instead of preinst, we launch it here :
/usr/lib/alternc/fixperms.sh
echo "**********************************************"
echo "* *"
echo "* /!\ /!\ *"
echo "* ALTERNC: *"
echo "* Please run alternc.install to fully deploy *"
echo -e "\033[31m**********************************************"
echo "* *"
echo "* ALTERNC ACTION REQUESTED *"
echo "* *"
echo "* Please run alternc.install to fully deploy *"
echo "* *"
echo "**********************************************"
echo -e "\033[0m"
;;
abort-upgrade|abort-remove|abort-deconfigure)
......
#!/bin/bash
#!/bin/bash -e
# ----------------------------------------------------------------------
# AlternC - Web Hosting System
......@@ -28,8 +28,6 @@ if [ `id -u` -ne 0 ]; then
exit 1
fi
set -e
for i in $*; do
case "$i" in
-f|--force)
......@@ -114,6 +112,8 @@ fi
# Upgrade the DATA and DB SCHEMA
/usr/share/alternc/install/upgrade_check.sh
# Launch upgrade of alternc modules
run-parts --arg=upgrade /usr/lib/alternc/install.d
#######################################################################
......@@ -340,6 +340,26 @@ if [ -x /usr/sbin/apache2 ]; then
SERVICES="$SERVICES $s"
fi
# Manage sudoers.d include appearing in Squeeze:
# if the "includedir" is not here, we add it ONLY IF visudo -c is happy.
if ! grep -q "#includedir */etc/sudoers.d" /etc/sudoers ; then
if ! cat /etc/sudoers.d/* | visudo -c -f - >/dev/null ; then
echo -e "\033[31m**********************************************"
echo "* *"
echo "* ALTERNC ACTION REQUESTED *"
echo "* *"
echo "* SUDO is NOT configured properly *"
echo "* check your files in /etc/sudoers.d ! *"
echo "* then launch alternc.install again *"
echo "* *"
echo "**********************************************"
echo -e "\033[0m"
exit 1
else
echo "#includedir */etc/sudoers.d" >>/etc/sudoers
fi
fi
# Copy postfix *_checks if they do not exist
for file in body_checks header_checks; do
if [ ! -e "/etc/postfix/$file" ]; then
......@@ -355,12 +375,17 @@ fi
if [ ! -f /etc/postfix/main.cf ]
then
echo "****************************************"
echo "POSTFIX is NOT configured properly"
echo "please launch dpkg-reconfigure -plow postfix"
echo "and choose 'Internet Site'"
echo "then launch alternc.install again"
echo "****************************************"
echo -e "\033[31m**********************************************"
echo "* *"
echo "* ALTERNC ACTION REQUESTED *"
echo "* *"
echo "* POSTFIX is NOT configured properly *"
echo "* launch dpkg-reconfigure -plow postfix *"
echo "* and choose 'Internet Site' *"
echo "* then launch alternc.install again *"
echo "* *"
echo "**********************************************"
echo -e "\033[0m"
exit 1
fi
......@@ -381,13 +406,14 @@ grep -v '^\ *#' $postfix_conf |while read line ; do
if [ -e $cert_file ];then
postconf -e "$line"
else
echo "****************************************"
echo "The certificate file : $cert_file does not exists"
echo "please go to https://alternc.org/wiki/SSL to get information on how to create a certificate"
echo "Then edit the file /etc/alternc/postfix/postfix.cf to add"
echo "the cert file path name to the key :smtpd_tls_cert_file"
echo "Finally relaunch alternc.install"
echo "****************************************"
echo -e "\033[31m*****************************************************"
echo "* The certificate file : $cert_file does not exists *"
echo "* If you want to be able to use SSL/TLS *"
echo "* please go to https://alternc.org/wiki/SSL *"
echo "* to get information on how to create a certificate *"
echo "* Finally relaunch alternc.install *"
echo "*****************************************************"
echo -e "\033[0m"
fi
else
postconf -e "$line"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment