Subversion Repositories ALCASAR

Rev

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

Rev 2457 Rev 2458
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2457 2017-12-10 14:11:01Z richard $
2
#  $Id: alcasar.sh 2458 2017-12-10 15:26:10Z 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 166... Line 166...
166
		if [ $Lang == "fr" ]
166
		if [ $Lang == "fr" ]
167
			then echo -n "La version "; echo -n $current_version ; echo " d'ALCASAR est déjà installée";
167
			then echo -n "La version "; echo -n $current_version ; echo " d'ALCASAR est déjà installée";
168
			else echo -n "ALCASAR Version "; echo -n $current_version ; echo " is already installed";
168
			else echo -n "ALCASAR Version "; echo -n $current_version ; echo " is already installed";
169
		fi
169
		fi
170
		response=0
170
		response=0
171
		PTN='^[oOnNyY]$'
171
		PTN='^[12]$'
172
		until [[ $(expr $response : $PTN) -gt 0 ]]
172
		until [[ $(expr $response : $PTN) -gt 0 ]]
173
		do
173
		do
174
			if [ $Lang == "fr" ]
174
			if [ $Lang == "fr" ]
-
 
175
			then
175
				then echo -n "Voulez-vous effectuer une mise à jour (O/n)? ";
176
				echo "Effectuer une mise à jour : tapez '1'"
-
 
177
				echo -n "Effectuer une réinstallation : Tapez '2' : "
-
 
178
			else
176
				else echo -n "Do you want to update (Y/n)?";
179
				echo "Perform an update : Hit '1'"
-
 
180
				echo -n "Perform a reinstallation : Hit '2' : "
177
			 fi
181
			 fi
178
			read response
182
			read response
179
		done
183
		done
180
		if [ "$response" = "n" ] || [ "$response" = "N" ]
184
		if [ "$response" = "2" ]
181
		then
185
		then
182
			rm -f /tmp/alcasar-conf*
186
			rm -f /tmp/alcasar-conf*
183
		else
187
		else
184
# Retrieve former NICname
188
# Retrieve former NICname
185
			EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2`				# EXTernal InterFace
189
			EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2`				# EXTernal InterFace
Line 503... Line 507...
503
	PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1`	# First network address (ex.: 192.168.182.1)
507
	PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1`	# First network address (ex.: 192.168.182.1)
504
	PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1`	# last network address (ex.: 192.168.182.254)
508
	PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1`	# last network address (ex.: 192.168.182.254)
505
	PRIVATE_MAC=`/usr/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` 	# MAC address of INTIF
509
	PRIVATE_MAC=`/usr/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` 	# MAC address of INTIF
506
# Define Internet parameters
510
# Define Internet parameters
507
	DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1`	# 1st DNS server
511
	DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1`	# 1st DNS server
508
	if [ "$DNS1" != "" ] && [ "$DNS1" != "127.0.0.1" ]
512
	if [ "$DNS1" == "" ] || [ "$DNS1" == "127.0.0.1" ]
509
	then
513
	then
510
		if [ $Lang == "fr" ]
514
		if [ $Lang == "fr" ]
511
		then
515
		then
512
		       	echo "L'adresse IP des serveurs DNS ne sont pas corrects"
516
		       	echo "L'adresse IP des serveurs DNS ne sont pas corrects"
513
			echo "Vérifiez la configuration de la carte réseau externe ($EXTIF)"
517
			echo "Vérifiez la configuration de la carte réseau externe ($EXTIF)"
Line 2328... Line 2332...
2328
		then
2332
		then
2329
			exit 0
2333
			exit 0
2330
		fi
2334
		fi
2331
		if [ -e $CONF_FILE ]
2335
		if [ -e $CONF_FILE ]
2332
		then
2336
		then
2333
# Uninstall the running version
2337
# Uninstall or update the running version
-
 
2338
			if [ "$mode" == "update" ]
-
 
2339
			then
2334
			$DIR_SCRIPTS/alcasar-uninstall.sh -update
2340
				$DIR_SCRIPTS/alcasar-uninstall.sh -update
-
 
2341
			else
-
 
2342
				$DIR_SCRIPTS/alcasar-uninstall.sh -full
-
 
2343
			fi
2335
		fi
2344
		fi
2336
# Test if manual update
2345
# Test if manual update
2337
		if [ -e /tmp/alcasar-conf*.tar.gz ] && [ "$mode" == "install" ]
2346
		if [ -e /tmp/alcasar-conf*.tar.gz ] && [ "$mode" == "install" ]
2338
		then
2347
		then
2339
			header_install
2348
			header_install