Subversion Repositories ALCASAR

Rev

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

Rev 1578 Rev 1585
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1578 2015-03-03 11:19:10Z richard $ 
2
#  $Id: alcasar.sh 1585 2015-03-06 16:15:41Z 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 488... Line 488...
488
	echo "INTIF=$INTIF" >> $CONF_FILE
488
	echo "INTIF=$INTIF" >> $CONF_FILE
489
	IP_SETTING=`grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2`		# IP setting (static or dynamic)
489
	IP_SETTING=`grep BOOTPROTO /etc/sysconfig/network-scripts/ifcfg-$EXTIF|cut -d"=" -f2`		# IP setting (static or dynamic)
490
	if [ $IP_SETTING == "dhcp" ]
490
	if [ $IP_SETTING == "dhcp" ]
491
		then
491
		then
492
		echo "PUBLIC_IP=dhcp" >> $CONF_FILE
492
		echo "PUBLIC_IP=dhcp" >> $CONF_FILE
493
		echo "GW=dhcp" >> $CONF_FILE 
493
		echo "GW=dhcp" >> $CONF_FILE
-
 
494
		echo "DNS1=dhcp" >> $CONF_FILE
-
 
495
		echo "DNS2=dhcp" >> $CONF_FILE
494
	else
496
	else
495
		echo "PUBLIC_IP=$PUBLIC_IP/$PUBLIC_PREFIX" >> $CONF_FILE
497
		echo "PUBLIC_IP=$PUBLIC_IP/$PUBLIC_PREFIX" >> $CONF_FILE
496
		echo "GW=$PUBLIC_GATEWAY" >> $CONF_FILE 
498
		echo "GW=$PUBLIC_GATEWAY" >> $CONF_FILE
-
 
499
		echo "DNS1=$DNS1" >> $CONF_FILE
-
 
500
		echo "DNS2=$DNS2" >> $CONF_FILE
497
	fi
501
	fi
498
	echo "PUBLIC_MTU=$MTU" >> $CONF_FILE
502
	echo "PUBLIC_MTU=$MTU" >> $CONF_FILE
499
	echo "DNS1=$DNS1" >> $CONF_FILE
-
 
500
	echo "DNS2=$DNS2" >> $CONF_FILE
-
 
501
	echo "PRIVATE_IP=$PRIVATE_IP_MASK" >> $CONF_FILE
503
	echo "PRIVATE_IP=$PRIVATE_IP_MASK" >> $CONF_FILE
502
	echo "DHCP=on" >> $CONF_FILE
504
	echo "DHCP=on" >> $CONF_FILE
503
	echo "EXT_DHCP_IP=none" >> $CONF_FILE
505
	echo "EXT_DHCP_IP=none" >> $CONF_FILE
504
	echo "RELAY_DHCP_IP=none" >> $CONF_FILE
506
	echo "RELAY_DHCP_IP=none" >> $CONF_FILE
505
	echo "RELAY_DHCP_PORT=none" >> $CONF_FILE
507
	echo "RELAY_DHCP_PORT=none" >> $CONF_FILE
Line 519... Line 521...
519
EOF
521
EOF
520
# EXTIF (Internet) config
522
# EXTIF (Internet) config
521
	[ -e /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF ] || cp /etc/sysconfig/network-scripts/ifcfg-$EXTIF /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF
523
	[ -e /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF ] || cp /etc/sysconfig/network-scripts/ifcfg-$EXTIF /etc/sysconfig/network-scripts/default-ifcfg-$EXTIF
522
	if [ $IP_SETTING == "dhcp" ]
524
	if [ $IP_SETTING == "dhcp" ]
523
		then
525
		then
524
		$SED "s?^RESOLV_MODS=.*?RESOLV_MODS=yes?g" /etc/sysconfig/network-scripts/ifcfg-$EXTIF
526
		cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
525
		$SED "s?^PEERDNS=.*?PEERDNS=no?g" /etc/sysconfig/network-scripts/ifcfg-$EXTIF
527
DEVICE=$EXTIF
-
 
528
BOOTPROTO=dhcp
526
		echo "DNS1=127.0.0.1" >> /etc/sysconfig/network-scripts/ifcfg-$EXTIF
529
DNS1=127.0.0.1
-
 
530
PEERDNS=no
-
 
531
RESOLV_MODS=yes
-
 
532
ONBOOT=yes
-
 
533
METRIC=10
-
 
534
MII_NOT_SUPPORTED=yes
-
 
535
IPV6INIT=no
-
 
536
IPV6TO4INIT=no
-
 
537
ACCOUNTING=no
-
 
538
USERCTL=no
-
 
539
MTU=$MTU
-
 
540
EOF
527
	else	
541
		else	
528
		cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
542
		cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$EXTIF
529
DEVICE=$EXTIF
543
DEVICE=$EXTIF
530
BOOTPROTO=static
544
BOOTPROTO=static
531
IPADDR=$PUBLIC_IP
545
IPADDR=$PUBLIC_IP
532
NETMASK=$PUBLIC_NETMASK
546
NETMASK=$PUBLIC_NETMASK