Subversion Repositories ALCASAR

Rev

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

Rev 2176 Rev 2192
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 2176 2017-04-24 21:30:26Z richard $ 
2
#  $Id: alcasar.sh 2192 2017-05-01 19:52:53Z 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 194... Line 194...
194
			echo
194
			echo
195
			if [ $Lang == "fr" ]
195
			if [ $Lang == "fr" ]
196
				then	
196
				then	
197
				echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
197
				echo "La mise à jour automatique d'ALCASAR ne peut pas être réalisée."
198
				echo "1 - Effectuez une sauvegarde des fichiers de traçabilité et de la base des usagers via l'ACC"
198
				echo "1 - Effectuez une sauvegarde des fichiers de traçabilité et de la base des usagers via l'ACC"
199
				echo "2 - Installez Linux-Mageia 5 et ALCASAR (cf. doc d'installation)"
199
				echo "2 - Installez Linux-Mageia 5.1-64bits et ALCASAR (cf. doc d'installation)"
200
				echo "3 - Importez votre base des usagers"
200
				echo "3 - Importez votre base des usagers"
201
			else
201
			else
202
				echo "The automatic update of ALCASAR can't be performed."
202
				echo "The automatic update of ALCASAR can't be performed."
203
				echo "1 - Save your traceability files and the user database"
203
				echo "1 - Save your traceability files and the user database"
204
				echo "2 - Install Linux-Mageia 5 & ALCASAR (cf. installation doc)"
204
				echo "2 - Install Linux-Mageia 5.1-64bits & ALCASAR (cf. installation doc)"
205
				echo "3 - Import your users database"
205
				echo "3 - Import your users database"
206
			fi
206
			fi
207
		else
207
		else
208
			if [ $Lang == "fr" ]
208
			if [ $Lang == "fr" ]
209
				then	
209
				then	
Line 213... Line 213...
213
			fi
213
			fi
214
		fi
214
		fi
215
		echo
215
		echo
216
		if [ $Lang == "fr" ]
216
		if [ $Lang == "fr" ]
217
			then	
217
			then	
218
			echo "Le système d'exploitation doit être remplacé (Mageia5)"
218
			echo "Le système d'exploitation doit être remplacé (Mageia5.1-64bits)"
219
		else
219
		else
220
			echo "The OS must be replaced (Mageia5)"
220
			echo "The OS must be replaced (Mageia5.1-64bits)"
221
		fi
221
		fi
222
		exit 0
222
		exit 0
223
	fi
223
	fi
224
	if [ ! -d /var/log/netflow/porttracker ]
224
	if [ ! -d /var/log/netflow/porttracker ]
225
		then
225
		then
Line 1987... Line 1987...
1987
# switch to multi-users runlevel (instead of x11)
1987
# switch to multi-users runlevel (instead of x11)
1988
	ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
1988
	ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
1989
#	GRUB modifications (only one time)
1989
#	GRUB modifications (only one time)
1990
# limit wait time to 3s
1990
# limit wait time to 3s
1991
# create an alcasar entry instead of linux-nonfb
1991
# create an alcasar entry instead of linux-nonfb
1992
# change display to 1024*768 (vga791)
1992
# change display to 1024*768 (vga791) only if not on VM
1993
	grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
1993
	grub_already_modified=`grep ALCASAR /boot/grub/menu.lst|wc -l`
1994
	if [ $grub_already_modified == 0 ]
1994
	if [ $grub_already_modified == 0 ]
1995
		then
1995
		then
1996
		$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
1996
		$SED "s?^timeout.*?timeout 3?g" /boot/grub/menu.lst
1997
		$SED "s?^title linux?title ALCASAR?g" /boot/grub/menu.lst
1997
		$SED "s?^title linux?title ALCASAR?g" /boot/grub/menu.lst
1998
		$SED "/^kernel/s/splash quiet //" /boot/grub/menu.lst
1998
		$SED "/^kernel/s/splash quiet //" /boot/grub/menu.lst
1999
# is an virtual machine (proxmox, vmware, ) ?
1999
# is an virtual machine (proxmox, vmware, ) ?
2000
		vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l`
2000
		vm_vga=`lsmod | egrep "virtio|vmwgfx" | wc -l`
2001
		if [ $vm_mga == 0 ]
2001
		if [ $vm_vga == 0 ]
2002
		then
2002
		then
2003
			$SED "/^kernel/s/$/ vga=791/" /boot/grub/menu.lst
2003
			$SED "/^kernel/s/$/ vga=791/" /boot/grub/menu.lst
2004
		fi
2004
		fi
2005
		$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
2005
		$SED "/^kernel/s/BOOT_IMAGE=linux /BOOT_IMAGE=linux-nonfb /" /boot/grub/menu.lst
2006
		$SED "/^gfxmenu/d" /boot/grub/menu.lst
2006
		$SED "/^gfxmenu/d" /boot/grub/menu.lst