Subversion Repositories ALCASAR

Rev

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

Rev 2054 Rev 2056
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-urpmi.sh 2054 2016-10-26 12:32:17Z raphael.pion $
2
# $Id: alcasar-urpmi.sh 2056 2016-10-29 10:12:33Z richard $
3
 
3
 
4
# alcasar-urpmi.sh
4
# alcasar-urpmi.sh
5
# by 3abtux and Rexy
5
# by 3abtux and Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 10... Line 10...
10
 
10
 
11
Lang=`echo $LANG|cut -c 1-2`
11
Lang=`echo $LANG|cut -c 1-2`
12
VERSION="5"
12
VERSION="5"
13
ARCH="i586" 
13
ARCH="i586" 
14
# The kernel version we compile netflow for
14
# The kernel version we compile netflow for
15
KERNEL="kernel-server-4.4.13-1.mga5-1-1.mga5"
15
KERNEL="kernel-server-4.4.26-1.mga5-1-1.mga5"
16
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
16
# ****** Alcasar needed RPMS - paquetages nécessaires au fonctionnement d'Alcasar ******
17
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysqli php-mbstring php-sockets php-cli php-curl php-pdo_sqlite php-json rng-utils rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd pm-fallback-policy ipset cronie-anacron gammu usbutils locales-en usb_modeswitch tinyproxy vnstat php-gd sudo iftop man kernel-firmware-nonfree dos2unix p7zip"
17
PACKAGES="vim-enhanced freeradius freeradius-mysql freeradius-ldap apache apache-mod_ssl apache-mod_php dansguardian postfix mariadb ntp bind-utils openssh-server php-xml php-ldap php-mysqli php-mbstring php-sockets php-cli php-curl php-pdo_sqlite php-json rng-utils rsync clamav perl-rrdtool perl-MailTools perl-Socket6 fail2ban gnupg ulogd pm-fallback-policy ipset cronie-anacron gammu usbutils locales-en usb_modeswitch tinyproxy vnstat php-gd sudo iftop man kernel-firmware-nonfree dos2unix p7zip"
18
 
18
 
19
rpm_repository_sync ()
19
rpm_repository_sync ()
20
{
20
{
Line 68... Line 68...
68
# We prefer wget than curl
68
# We prefer wget than curl
69
urpmi --no-verify-rpm --auto rpms/$ARCH/wget*.rpm
69
urpmi --no-verify-rpm --auto rpms/$ARCH/wget*.rpm
70
 
70
 
71
# Set the RPM repository (if not already set)
71
# Set the RPM repository (if not already set)
72
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l`
72
ACTIVE_REPO=`cat /etc/urpmi/urpmi.cfg|grep "mageia.org"|wc -l`
73
#if [ "$ACTIVE_REPO" != "2" ]
-
 
74
#	then
-
 
75
	MIRROR_NBR=2
73
MIRROR_NBR=2
76
	#                       For Europeans 
74
#                       For Europeans 
77
	MIRRORLIST1="http://www.mirrorservice.org/sites/mageia.org/pub/mageia/distrib/$VERSION/$ARCH"
75
MIRRORLIST1="http://www.mirrorservice.org/sites/mageia.org/pub/mageia/distrib/$VERSION/$ARCH"
78
	#                       For International install
76
#                       For International install
79
	MIRRORLIST2="http://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list"
77
MIRRORLIST2="http://mirrors.mageia.org/api/mageia.$VERSION.$ARCH.list"
80
	try_nb="0"; nb_repository="0"
78
try_nb="0"; nb_repository="0"
81
	while [ "$nb_repository" != "4" ]
79
while [ "$nb_repository" != "4" ]
82
	do
80
do
83
		try_nb=`expr $try_nb + 1`
81
	try_nb=`expr $try_nb + 1`
84
		MIRRORLIST="MIRRORLIST$try_nb"
82
	MIRRORLIST="MIRRORLIST$try_nb"
85
		rpm_repository_sync 
83
	rpm_repository_sync 
86
		nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
84
	nb_repository=`cat /etc/urpmi/urpmi.cfg|grep mirrorlist|wc -l`
87
		if [ "$nb_repository" != "4" ]
85
	if [ "$nb_repository" != "4" ]
-
 
86
	then
-
 
87
		if [ $Lang == "fr" ]
-
 
88
		then	
-
 
89
			echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
-
 
90
		else
-
 
91
			echo "An error occurs when synchronising the repositories N°$try_nb"
-
 
92
		fi
-
 
93
		if [ $(expr $try_nb) -eq $MIRROR_NBR ]
-
 
94
		then
-
 
95
			rpm_error
-
 
96
			exit 1
-
 
97
		fi
-
 
98
		if [ $Lang == "fr" ]
-
 
99
		then	
-
 
100
			echo "Voulez-vous tenter une synchronisation avec un autre dépôt?"
-
 
101
		else
-
 
102
			echo "Do you wan't to try a synchronisation with an other repository?"
-
 
103
		fi
-
 
104
		response=0
-
 
105
		PTN='^[oOnNyY]$'
-
 
106
		until [[ $(expr $response : $PTN) -gt 0 ]]
-
 
107
		do
-
 
108
			read response
-
 
109
		done
-
 
110
		if [ "$response" = "n" ] || [ "$response" = "N" ] 
88
		then
111
		then
89
			if [ $Lang == "fr" ]
-
 
90
			then	
-
 
91
				echo "Une erreur a été détectée lors de la synchronisation avec le dépot N°$try_nb."
-
 
92
			else
-
 
93
				echo "An error occurs when synchronising the repositories N°$try_nb"
-
 
94
			fi
-
 
95
			if [ $(expr $try_nb) -eq $MIRROR_NBR ]
-
 
96
			then
-
 
97
				rpm_error
-
 
98
				exit 1
-
 
99
			fi
-
 
100
			if [ $Lang == "fr" ]
-
 
101
			then	
-
 
102
				echo "Voulez-vous tenter une synchronisation avec un autre dépôt?"
-
 
103
			else
-
 
104
				echo "Do you wan't to try a synchronisation with an other repository?"
-
 
105
			fi
-
 
106
			response=0
-
 
107
			PTN='^[oOnNyY]$'
-
 
108
			until [[ $(expr $response : $PTN) -gt 0 ]]
-
 
109
			do
-
 
110
				read response
-
 
111
			done
-
 
112
			if [ "$response" = "n" ] || [ "$response" = "N" ] 
-
 
113
			then
-
 
114
			exit 1
112
			exit 1
115
			fi
-
 
116
		fi
113
		fi
117
	done
114
	fi
118
#fi
115
done
119
 
116
 
120
# download the kernel used by ALCASAR and fix its version
117
# download the kernel used by ALCASAR and fix its version
121
if [ $Lang == "fr" ]
118
if [ $Lang == "fr" ]
122
then	
119
then	
123
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."
120
	echo "Récupération du noyau Linux exploité par ALCASAR. Veuillez patienter ..."