forked from services/mlmmj-light-web-ecg
Removed unnecessary files
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
lists_path = /home/pacs/ecg00/users/mlmmj
|
||||
web_path = /home/pacs/ecg00/users/mlmmj/doms/list.ecogood.org/htdocs-ssl
|
||||
language = en
|
||||
web_url = https://list.ecogood.org/
|
||||
114
misc/init.sh
114
misc/init.sh
@@ -1,114 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$#" -ne 0 ]; then
|
||||
echo "This script install mlmmj-light-web with necessary dependencies."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" != "0" ]; then
|
||||
echo "This script must be run as root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "I strongly recommend to run this sctipt only on a clean Debian with only standard system utilities installed (netinst iso)."
|
||||
read -p "Are you sure to install mlmmj-light-web? [Y/n]: " reply
|
||||
reply=${reply:-y}
|
||||
if [[ ! $reply =~ ^[yY][eE][sS]|[yY]$ ]]
|
||||
then
|
||||
echo "Aborted."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -p "What language are you want mlmmj-light-web to use? [EN/ru]: " reply
|
||||
reply=${reply:-en}
|
||||
while :
|
||||
do
|
||||
case "${reply}" in
|
||||
[eE][nN] )
|
||||
lang="en"
|
||||
break
|
||||
;;
|
||||
[rR][uU] )
|
||||
lang="ru"
|
||||
break
|
||||
;;
|
||||
* )
|
||||
read -p "Please, write, 'en' or 'ru': " reply
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
sed -i '/language/d' /tmp/mlmmj-light-web-master/misc/config.txt
|
||||
echo "language = ${lang}" >> /tmp/mlmmj-light-web-master/misc/config.txt
|
||||
|
||||
read -p "Please enter URL which you will use for mlmmj-light-web. [http://example.com/] : " url
|
||||
url=${url:-http://example.com/}
|
||||
|
||||
sed -i '/web_url/d' /tmp/mlmmj-light-web-master/misc/config.txt
|
||||
echo "web_url = ${url}" >> /tmp/mlmmj-light-web-master/misc/config.txt
|
||||
|
||||
echo
|
||||
echo "Updating packages list..."
|
||||
echo
|
||||
apt-get update
|
||||
echo
|
||||
echo "Installing software..."
|
||||
echo
|
||||
apt-get install -y mlmmj apg apache2 libapache2-mod-php5 gcc make
|
||||
echo
|
||||
echo "Creating mlmmj user..."
|
||||
echo
|
||||
useradd -r -s /bin/false mlmmj
|
||||
echo "Replacing apache user..."
|
||||
echo
|
||||
sed -i 's/www-data/mlmmj/g' /etc/apache2/envvars
|
||||
echo "Replacing cron task..."
|
||||
echo '0 */2 * * * /usr/bin/find /var/spool/mlmmj/ -maxdepth 1 -mindepth 1 -type d -exec /usr/bin/mlmmj-maintd -F -d "{}" \' > /etc/cron.d/mlmmj
|
||||
echo
|
||||
echo "Updating apache.conf..."
|
||||
echo
|
||||
# Replace the third occurence of "AllowOverride None" with "AllowOverride All"
|
||||
awk '/AllowOverride None/{c++;if(c==3){sub("AllowOverride None","AllowOverride All");c=0}}1' /etc/apache2/apache2.conf > /etc/apache2/apache2_.conf
|
||||
mv /etc/apache2/apache2_.conf /etc/apache2/apache2.conf
|
||||
echo "Restarting apache..."
|
||||
echo
|
||||
/etc/init.d/apache2 restart
|
||||
echo
|
||||
echo "Moving files..."
|
||||
echo
|
||||
mv /tmp/mlmmj-light-web-master/misc/move/exim4.conf /etc/exim4
|
||||
mv /tmp/mlmmj-light-web-master/misc/move/exim4.filter /etc/exim4
|
||||
mv /tmp/mlmmj-light-web-master/misc/move/mlmmj-footer-receive /usr/bin
|
||||
echo "Unpacking templates..."
|
||||
echo
|
||||
tar xzvf /tmp/mlmmj-light-web-master/misc/templates.tar.gz -C /tmp/mlmmj-light-web-master/misc
|
||||
rm /tmp/mlmmj-light-web-master/misc/templates.tar.gz
|
||||
echo
|
||||
echo "Unpacking smarty..."
|
||||
tar xzvf /tmp/mlmmj-light-web-master/misc/smarty.tar.gz -C /tmp/mlmmj-light-web-master/misc
|
||||
rm /tmp/mlmmj-light-web-master/misc/smarty.tar.gz
|
||||
echo
|
||||
echo "Compiling foot_filter..."
|
||||
echo
|
||||
make -C /tmp/mlmmj-light-web-master/misc/move/foot_filter
|
||||
echo
|
||||
echo "Moving files..."
|
||||
echo
|
||||
mv /tmp/mlmmj-light-web-master/misc/move/foot_filter/foot_filter /usr/bin
|
||||
rm -rf /tmp/mlmmj-light-web-master/misc/move
|
||||
rm -rf /tmp/mlmmj-light-web-master/misc/init.sh
|
||||
rm -rf /var/www/html/*
|
||||
cp -rp /tmp/mlmmj-light-web-master/* /var/www/html
|
||||
echo "Removing all installation files..."
|
||||
echo
|
||||
rm -rf /tmp/mlmmj-light-web-master
|
||||
rm -rf /tmp/master.tar.gz
|
||||
echo "Setting ownership of files..."
|
||||
echo
|
||||
chown mlmmj:mlmmj -R /var/www/html
|
||||
chown mlmmj:mlmmj -R /var/spool/mlmmj
|
||||
echo "Installation of mlmmj-light-web completed. Please, specify the fully qualified domain name (FQDN) in /etc/hostname and /etc/mailname if you have not done this already. Currently these files contain:"
|
||||
echo "/etc/hostname: " $(cat /etc/hostname)
|
||||
echo "/etc/mailname: " $(cat /etc/mailname)
|
||||
echo
|
||||
echo "Now visit ${url} in your browser."
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function load_config()
|
||||
{
|
||||
parent_path=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
|
||||
lists_path=$(cat $parent_path/config.txt | grep lists_path | sed 's/.*=//g' | sed 's/[[:blank:]]//g')
|
||||
web_url=$(cat $parent_path/config.txt | grep web_url | sed 's/.*=//g' | sed 's/[[:blank:]]//g')
|
||||
}
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "With this script you can create and delete domains for mailing lists."
|
||||
echo
|
||||
echo "Usage:"
|
||||
echo "$0 add list.example.com"
|
||||
echo "$0 del list.example.com"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
load_config
|
||||
operation=$1
|
||||
domain=$2
|
||||
|
||||
if [ "${operation}" = "add" ]; then
|
||||
password=$(apg -MCLN -m 12 -a 1 -n 1)
|
||||
hash=$(echo -n $password | sha256sum | head -c 64)
|
||||
mkdir -p $lists_path/$domain
|
||||
echo $domain:$hash >> $lists_path/passwords.txt
|
||||
chown mlmmj:mlmmj -R $lists_path
|
||||
echo -e "Domain: ${domain} \nPass: ${password}\nURL: ${web_url}"
|
||||
fi
|
||||
|
||||
if [ "${operation}" = "del" ]; then
|
||||
find_domain=$(sed -n "/^${domain}:.*/p" $lists_path/passwords.txt)
|
||||
if [ -z "${find_domain}" ]; then
|
||||
echo "ERROR: No such domain. Aborting."
|
||||
exit 1
|
||||
else
|
||||
sed -i -e "/^${domain}:.*/d" $lists_path/passwords.txt
|
||||
rm -r $lists_path/$domain
|
||||
echo -e "Domain $domain has been deleted."
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user