Subversion Repositories ALCASAR

Rev

Rev 1957 | Rev 1963 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1957 Rev 1961
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1957 2016-06-21 22:16:17Z richard $ 
2
#  $Id: alcasar.sh 1961 2016-06-23 21:23:34Z richard $ 
3
 
3
 
4
# alcasar.sh
4
# alcasar.sh
5
 
5
 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
6
# ALCASAR Install script -  CopyLeft ALCASAR Team [Rexy + 3abtux + Steweb + Crox + ...] 
7
# Ce programme est un logiciel libre ; This software is free and open source
7
# Ce programme est un logiciel libre ; This software is free and open source
Line 185... Line 185...
185
			then
185
			then
186
			echo
186
			echo
187
			if [ $Lang == "fr" ]
187
			if [ $Lang == "fr" ]
188
				then	
188
				then	
189
				echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
189
				echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
190
				echo "1 - Récupérez le fichier de configuration actuel (/tmp/alcasar-conf.tar.gz)."
190
				echo "1 - Effectuez une sauvegarde des fichiers de traçabilité et de la base des usagers via l'ACC"
191
				echo "2 - Installez Linux-Mageia 5 (cf. doc d'installation)"
191
				echo "2 - Installez Linux-Mageia 5 et ALCASAR (cf. doc d'installation)"
192
				echo "3 - recopiez le fichier 'alcasar-conf.tar.gz' dans le répertoire '/tmp' avant de lancer l'installation d'ALCASAR"
192
				echo "3 - Importez votre base des usagers"
193
			else
193
			else
194
				echo "The automatic update of ALCASAR can't be performed."
194
				echo "The automatic update of ALCASAR can't be performed."
195
				echo "1 - Retrieve the configuration file (/tmp/alcasar-conf.tar.gz)"
195
				echo "1 - Save your traceability files and the user database"
196
				echo "2 - Install Linux-Mageia 5 (cf. installation doc)"
196
				echo "2 - Install Linux-Mageia 5 & ALCASAR (cf. installation doc)"
197
				echo "3 - Copy again the file 'alcasar-conf.tar.gz' in the folder '/tmp' before launching the installation of ALCASAR"
197
				echo "3 - Import your users database"
198
			fi
198
			fi
199
		else
199
		else
200
			if [ $Lang == "fr" ]
200
			if [ $Lang == "fr" ]
201
				then	
201
				then	
202
				echo "L'installation d'ALCASAR ne peut pas être réalisée."
202
				echo "L'installation d'ALCASAR ne peut pas être réalisée."
Line 1490... Line 1490...
1490
dnsmasq ()
1490
dnsmasq ()
1491
{
1491
{
1492
	[ -d /var/log/dnsmasq ] || mkdir /var/log/dnsmasq
1492
	[ -d /var/log/dnsmasq ] || mkdir /var/log/dnsmasq
1493
	[ -e /etc/sysconfig/dnsmasq.default ] || cp /etc/sysconfig/dnsmasq /etc/sysconfig/dnsmasq.default
1493
	[ -e /etc/sysconfig/dnsmasq.default ] || cp /etc/sysconfig/dnsmasq /etc/sysconfig/dnsmasq.default
1494
	$SED "s?^OPTION=.*?OPTION=-C /etc/dnsmasq.conf?g" /etc/sysconfig/dnsmasq # default conf file for the first dnsmasq instance
1494
	$SED "s?^OPTION=.*?OPTION=-C /etc/dnsmasq.conf?g" /etc/sysconfig/dnsmasq # default conf file for the first dnsmasq instance
-
 
1495
	$SED "s?^local=.*?local=/$DOMAIN/?g" $DIR_DEST_ETC/alcasar-dns-name # default domain name for all dnsmasq daemons
1495
	[ -e /etc/dnsmasq.conf.default ] || cp /etc/dnsmasq.conf /etc/dnsmasq.conf.default
1496
	[ -e /etc/dnsmasq.conf.default ] || cp /etc/dnsmasq.conf /etc/dnsmasq.conf.default
1496
# 1st dnsmasq listen on udp 53 ("dnsmasq - forward"). It's used as dhcp server only if "alcasar-bypass" is on.
1497
# 1st dnsmasq listen on udp 53 ("dnsmasq - forward"). It's used as dhcp server only if "alcasar-bypass" is on.
1497
	cat << EOF > /etc/dnsmasq.conf
1498
	cat << EOF > /etc/dnsmasq.conf
1498
# Configuration file for "dnsmasq in forward mode"
1499
# Configuration file for "dnsmasq in forward mode"
1499
conf-file=$DIR_DEST_ETC/alcasar-dns-name	# local DNS resolutions
1500
conf-file=$DIR_DEST_ETC/alcasar-dns-name	# local DNS resolutions
Line 1503... Line 1504...
1503
no-dhcp-interface=$INTIF
1504
no-dhcp-interface=$INTIF
1504
no-dhcp-interface=tun0
1505
no-dhcp-interface=tun0
1505
no-dhcp-interface=lo
1506
no-dhcp-interface=lo
1506
bind-interfaces
1507
bind-interfaces
1507
cache-size=2048
1508
cache-size=2048
1508
domain=$DOMAIN
-
 
1509
domain-needed
1509
domain-needed
1510
expand-hosts
1510
expand-hosts
1511
bogus-priv
1511
bogus-priv
1512
filterwin2k
1512
filterwin2k
1513
server=$DNS1
1513
server=$DNS1
1514
server=$DNS2
1514
server=$DNS2
1515
# DHCP service is configured. It will be enabled in "bypass" mode
1515
# DHCP service is configured. It will be enabled in "bypass" mode
1516
#dhcp-range=$PRIVATE_FIRST_IP,$PRIVATE_LAST_IP,$PRIVATE_NETMASK,12h
1516
#dhcp-range=$PRIVATE_FIRST_IP,$PRIVATE_LAST_IP,$PRIVATE_NETMASK,12h
1517
#dhcp-option=option:router,$PRIVATE_IP
1517
#dhcp-option=option:router,$PRIVATE_IP
1518
#dhcp-option=option:ntp-server,$PRIVATE_IP
1518
#dhcp-option=option:ntp-server,$PRIVATE_IP
-
 
1519
#domain=$DOMAIN
1519
 
1520
 
1520
# Exemple of static dhcp assignation : <@MAC>,<name>,<@IP>,<MASK>,<ttl bail>
1521
# Exemple of static dhcp assignation : <@MAC>,<name>,<@IP>,<MASK>,<ttl bail>
1521
#dhcp-host=11:22:33:44:55:66,ssic-test,192.168.182.20,255.255.255.0,45m
1522
#dhcp-host=11:22:33:44:55:66,ssic-test,192.168.182.20,255.255.255.0,45m
1522
EOF
1523
EOF
1523
# 2nd dnsmasq listen on udp 54 ("dnsmasq with blacklist")
1524
# 2nd dnsmasq listen on udp 54 ("dnsmasq with blacklist")
Line 1532... Line 1533...
1532
no-dhcp-interface=$INTIF
1533
no-dhcp-interface=$INTIF
1533
no-dhcp-interface=tun0
1534
no-dhcp-interface=tun0
1534
no-dhcp-interface=lo
1535
no-dhcp-interface=lo
1535
bind-interfaces
1536
bind-interfaces
1536
cache-size=2048
1537
cache-size=2048
1537
domain=$DOMAIN
-
 
1538
domain-needed
1538
domain-needed
1539
expand-hosts
1539
expand-hosts
1540
bogus-priv
1540
bogus-priv
1541
filterwin2k
1541
filterwin2k
1542
server=$DNS1
1542
server=$DNS1
Line 1554... Line 1554...
1554
no-dhcp-interface=$INTIF
1554
no-dhcp-interface=$INTIF
1555
no-dhcp-interface=tun0
1555
no-dhcp-interface=tun0
1556
no-dhcp-interface=lo
1556
no-dhcp-interface=lo
1557
bind-interfaces
1557
bind-interfaces
1558
cache-size=1024
1558
cache-size=1024
1559
domain=$DOMAIN
-
 
1560
domain-needed
1559
domain-needed
1561
expand-hosts
1560
expand-hosts
1562
bogus-priv
1561
bogus-priv
1563
filterwin2k
1562
filterwin2k
1564
ipset=/#/wl_ip_allowed			# dynamicly add the resolv IP address in the Firewall rules
1563
ipset=/#/wl_ip_allowed			# dynamicly add the resolv IP address in the Firewall rules
Line 1575... Line 1574...
1575
no-dhcp-interface=$INTIF
1574
no-dhcp-interface=$INTIF
1576
no-dhcp-interface=tun0
1575
no-dhcp-interface=tun0
1577
no-dhcp-interface=lo
1576
no-dhcp-interface=lo
1578
bind-interfaces
1577
bind-interfaces
1579
cache-size=256
1578
cache-size=256
1580
domain=$DOMAIN
-
 
1581
domain-needed
1579
domain-needed
1582
expand-hosts
1580
expand-hosts
1583
bogus-priv
1581
bogus-priv
1584
filterwin2k
1582
filterwin2k
1585
EOF
1583
EOF