/scripts/alcasar-mail-install-V2.sh |
---|
0,0 → 1,93 |
#!/bin/bash |
############################################################################################################################## |
## |
## ALCASAR SERVICE MAIL INSTALL |
## |
## Script by joss_p |
## V 1.0 Dec 2021. |
## This script configure the mail conf file and execute the fonfiguration from the acc. |
## |
## |
############################################################################################################################## |
#. /usr/local/etc/alcasar-mail.conf |
saslPath="/etc/postfix/sasl" |
smtpIP="0.0.0.0/0" |
if [[ ${#} -ne 0 ]] |
then |
while getopts ":s:p:r:m:o:a:w:123" option |
do |
case $option in |
1) |
TYPE_MAIL=1 |
;; |
2) |
TYPE_MAIL=2 |
;; |
3) |
TYPE_MAIL=3 |
;; |
s) |
smtp=$OPTARG |
;; |
p) |
port=$OPTARG |
;; |
r) |
smtpIP=$OPTARG |
;; |
m) |
mailAddr=$OPTARG |
;; |
o) |
mailMdp=$OPTARG |
;; |
a) |
adminMail=$OPTARG |
;; |
w) |
whiteDomain=$OPTARG |
;; |
:) |
echo "L'option $OPTARG requiert un argument" |
exit 1 |
;; |
\?) |
echo "$OPTARG : option invalide" |
exit 1 |
;; |
esac |
done |
fi |
if [[ $TYPE_MAIL -eq 2 ]]; then |
echo "relayhost = [${smtp}]:${port}" >> /etc/postfix/main.cf |
elif [[ $TYPE_MAIL -eq 3 ]]; then |
echo "relayhost = [${smtp}]:${port}" >> /etc/postfix/main.cf |
[ -d ${saslPath} ] || mkdir ${saslPath} |
echo "[${smtp}]:${port} ${mailAddr}:${mailMdp}" > ${saslPath}/sasl_passwd |
postmap ${saslPath}/sasl_passwd |
chmod -R 777 ${saslPath} |
#chown root:root ${saslPath}/sasl_passwd* |
#chmod 0600 ${saslPath}/sasl_passwd* |
else |
echo "Erreur ! Aucun type de messagerie sélectionné !" |
exit 0 |
fi |
old_smtpIP=`grep "SMTP_IP=" /usr/local/etc/alcasar-iptables-local.sh | cut -d "'" -f2` |
old_port=`grep "SMTP_PORT=" /usr/local/etc/alcasar-iptables-local.sh | cut -d "=" -f2 | cut -f1` |
sed -ie "/SMTP_IP=/ s@${old_smtpIP}@${smtpIP}@" /usr/local/etc/alcasar-iptables-local.sh |
sed -ie "/SMTP_PORT=/ s/${old_port}/${port}/" /usr/local/etc/alcasar-iptables-local.sh |
sed -ie "/SMTP_IP=/ s/^#//" /usr/local/etc/alcasar-iptables-local.sh |
sed -ie "/SMTP_PORT/ s/^#//g" /usr/local/etc/alcasar-iptables-local.sh |
#chmod 740 /usr/local/etc/alcasar-iptables-local.sh |
#chmod 700 /usr/local/bin/alcasar-iptables.sh |
bash /usr/local/bin/alcasar-iptables.sh |
exit 0 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |
Added: svn:executable |
+* |
\ No newline at end of property |
/scripts/alcasar-rpm.sh |
---|
4,8 → 4,8 |
# by 3abtux and Rexy |
# This script is distributed under the Gnu General Public License (GPL) |
# script de mise en place des dépots RPM |
# configure the RPM repository |
# script de mise en place des dépots RPM + installation des RPM complémentaires |
# configure the RPM repository + complementary RPM installation |
Lang=`echo $LANG|cut -c 1-2` |
SED="/bin/sed -i" |
19,8 → 19,9 |
# "lsscsi" & nvme-cli" : needed by phpsysinfo |
# "socat" : avoid a warning when run the install script of letsencrypt ("acme.sh") |
# "sudo" : needed after a reinstallation (to be investigated) |
# "clamav + clamav-db" : needed because of a lack of mutual dependance |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamav clamav-db clamd fail2ban gnupg2 ulogd pm-fallback-policy ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat" |
# "clamav" + "clamav-db" : needed because of a lack of mutual dependance |
# "postfix" + "cyrus-sasl" : email registration method |
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap lighttpd lighttpd-mod_auth php-fpm php-gd php-ldap php-mysqli php-mbstring php-sockets php-curl php-pdo_sqlite php-cli unbound e2guardian postfix mariadb ntp bind-utils openssh-server rng-utils rsync clamav clamav-db clamd fail2ban gnupg2 ulogd pm-fallback-policy ipset usb_modeswitch vnstat dos2unix p7zip msec kernel-userspace-headers kernel-firmware-nonfree dnsmasq dhcp-server tcpdump fonts-dejavu-common fonts-ttf-dejavu lsscsi nvme-cli sudo socat postfix cyrus-sasl" |
rpm_repository_sync () |
{ |
76,11 → 77,13 |
# Set the RPM repository (if not already set) |
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l` |
MIRROR_NBR=2 |
MIRROR_NBR=3 |
# For French |
MIRRORLIST1="http://ftp.free.fr/mirrors/mageia.org/distrib/$VERSION/$ARCH" |
# For Europeans |
MIRRORLIST1="https://www.mirrorservice.org/pub/mageia/distrib/$VERSION/$ARCH" |
# For International install |
MIRRORLIST2="https://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list" |
MIRRORLIST2="https://www.mirrorservice.org/pub/mageia/distrib/$VERSION/$ARCH" |
# For everybody |
MIRRORLIST3="https://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list" |
try_nb="0"; nb_repository="0" |
while [ "$nb_repository" != "4" ] |
do |