Subversion Repositories ALCASAR

Rev

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

Rev 1610 Rev 1613
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1610 2015-04-06 16:21:59Z franck $ 
2
#  $Id: alcasar.sh 1613 2015-04-07 12:14:12Z franck $ 
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 470... Line 470...
470
	private_broadcast_ending=`echo $PRIVATE_BROADCAST | cut -d"." -f4`				# last octet of LAN broadcast
470
	private_broadcast_ending=`echo $PRIVATE_BROADCAST | cut -d"." -f4`				# last octet of LAN broadcast
471
	PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1`	# First network address (ex.: 192.168.182.1)
471
	PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1`	# First network address (ex.: 192.168.182.1)
472
	PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1`	# last network address (ex.: 192.168.182.254)
472
	PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1`	# last network address (ex.: 192.168.182.254)
473
	PRIVATE_MAC=`/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` 	# MAC address of INTIF
473
	PRIVATE_MAC=`/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` 	# MAC address of INTIF
474
# Define Internet parameters
474
# Define Internet parameters
475
	DNS1=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|head -n 1`				# 1st DNS server
475
	DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1`				# 1st DNS server
476
	nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
476
	nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
477
	if [ $nb_dns == 2 ]
477
	if [ $nb_dns == 2 ]
478
		then
478
		then
479
		DNS2=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|tail -n 1`			# 2nd DNS server (if exist)
479
		DNS2=`grep ^nameserver /etc/resolv.conf|cut -d" " -f2|tail -n 1`			# 2nd DNS server (if exist)
480
	fi
480
	fi
Line 529... Line 529...
529
BOOTPROTO=dhcp
529
BOOTPROTO=dhcp
530
DNS1=127.0.0.1
530
DNS1=127.0.0.1
531
PEERDNS=no
531
PEERDNS=no
532
RESOLV_MODS=yes
532
RESOLV_MODS=yes
533
ONBOOT=yes
533
ONBOOT=yes
-
 
534
NOZEROCONF=yes
534
METRIC=10
535
METRIC=10
535
MII_NOT_SUPPORTED=yes
536
MII_NOT_SUPPORTED=yes
536
IPV6INIT=no
537
IPV6INIT=no
537
IPV6TO4INIT=no
538
IPV6TO4INIT=no
538
ACCOUNTING=no
539
ACCOUNTING=no
Line 1195... Line 1196...
1195
coaport		3799
1196
coaport		3799
1196
conup		$DIR_DEST_BIN/alcasar-conup.sh
1197
conup		$DIR_DEST_BIN/alcasar-conup.sh
1197
condown		$DIR_DEST_BIN/alcasar-condown.sh
1198
condown		$DIR_DEST_BIN/alcasar-condown.sh
1198
include		$DIR_DEST_ETC/alcasar-uamallowed
1199
include		$DIR_DEST_ETC/alcasar-uamallowed
1199
include		$DIR_DEST_ETC/alcasar-uamdomain
1200
include		$DIR_DEST_ETC/alcasar-uamdomain
1200
#dhcpgateway	none
1201
#dhcpgateway		none
1201
#dhcprelayagent	none
1202
#dhcprelayagent		none
1202
#dhcpgatewayport	none
1203
#dhcpgatewayport	none
1203
EOF
1204
EOF
1204
# create file for DHCP static ip. Reserve the second IP address for INTIF (the first one is for tun0)
1205
# create file for DHCP static ip. Reserve the second IP address for INTIF (the first one is for tun0)
1205
	echo "$PRIVATE_MAC $PRIVATE_SECOND_IP" > $DIR_DEST_ETC/alcasar-ethers
1206
	echo "$PRIVATE_MAC $PRIVATE_SECOND_IP" > $DIR_DEST_ETC/alcasar-ethers
1206
# create files for trusted domains and urls
1207
# create files for trusted domains and urls