Subversion Repositories ALCASAR

Rev

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

Rev 1808 Rev 1828
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
#  $Id: alcasar.sh 1808 2016-04-03 10:25:03Z richard $ 
2
#  $Id: alcasar.sh 1828 2016-04-19 09:56:14Z 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 59... Line 59...
59
DIR_SAVE="/var/Save"				# backup directory (traceability_log, user_db, security_log)
59
DIR_SAVE="/var/Save"				# backup directory (traceability_log, user_db, security_log)
60
DIR_WEB="/var/www/html"				# directory of APACHE
60
DIR_WEB="/var/www/html"				# directory of APACHE
61
DIR_DG="/etc/dansguardian"			# directory of DansGuardian
61
DIR_DG="/etc/dansguardian"			# directory of DansGuardian
62
DIR_ACC="$DIR_WEB/acc"				# directory of the 'ALCASAR Control Center'
62
DIR_ACC="$DIR_WEB/acc"				# directory of the 'ALCASAR Control Center'
63
DIR_DEST_BIN="/usr/local/bin"			# directory of ALCASAR scripts
63
DIR_DEST_BIN="/usr/local/bin"			# directory of ALCASAR scripts
64
DIR_DEST_SBIN="/usr/local/sbin"			# directory of ALCASAR admin scripts
-
 
65
DIR_DEST_ETC="/usr/local/etc"			# directory of ALCASAR conf files
64
DIR_DEST_ETC="/usr/local/etc"			# directory of ALCASAR conf files
66
DIR_DEST_SHARE="/usr/local/share"		# directory of share files used by ALCASAR (dnsmasq for instance)
65
DIR_DEST_SHARE="/usr/local/share"		# directory of share files used by ALCASAR (dnsmasq for instance)
67
CONF_FILE="$DIR_DEST_ETC/alcasar.conf"		# central ALCASAR conf file
66
CONF_FILE="$DIR_DEST_ETC/alcasar.conf"		# central ALCASAR conf file
68
PASSWD_FILE="/root/ALCASAR-passwords.txt"	# text file with the passwords and shared secrets
67
PASSWD_FILE="/root/ALCASAR-passwords.txt"	# text file with the passwords and shared secrets
69
# ******* DBMS parameters - paramètres SGBD ********
68
# ******* DBMS parameters - paramètres SGBD ********
Line 71... Line 70...
71
DB_USER="radius"				# user name allows to request the users database
70
DB_USER="radius"				# user name allows to request the users database
72
DB_GAMMU="gammu"				# database name used by Gammu-smsd
71
DB_GAMMU="gammu"				# database name used by Gammu-smsd
73
# ******* Network parameters - paramètres réseau *******
72
# ******* Network parameters - paramètres réseau *******
74
HOSTNAME="alcasar"				# default hostname
73
HOSTNAME="alcasar"				# default hostname
75
DOMAIN="localdomain"				# default local domain
74
DOMAIN="localdomain"				# default local domain
76
EXTIF=`/sbin/ip route|grep default|head -n1|cut -d" " -f5`						# EXTIF is connected to the ISP broadband modem/router (In France : Box-FAI)
75
EXTIF=`/usr/sbin/ip route|grep default|head -n1|cut -d" " -f5`							# EXTIF is connected to the ISP broadband modem/router (In France : Box-FAI)
77
INTIF=`/sbin/ip	link|grep '^[[:digit:]]:'|grep -v "lo\|$EXTIF\|tun0"|head -n1|cut -d" " -f2|tr -d ":"`	# INTIF is connected to the consultation network
76
INTIF=`/usr/sbin/ip link|grep '^[[:digit:]]:'|grep -v "lo\|$EXTIF\|tun0"|head -n1|cut -d" " -f2|tr -d ":"`	# INTIF is connected to the consultation network
78
MTU="1500"
77
MTU="1500"
79
DEFAULT_PRIVATE_IP_MASK="192.168.182.1/24"	# Default ALCASAR IP address
78
DEFAULT_PRIVATE_IP_MASK="192.168.182.1/24"	# Default ALCASAR IP address
80
# ****** Paths - chemin des commandes *******
79
# ****** Paths - chemin des commandes *******
81
SED="/bin/sed -i"
80
SED="/bin/sed -i"
82
# ****************** End of global parameters *********************
81
# ****************** End of global parameters *********************
Line 229... Line 228...
229
	if [ $Lang == "fr" ]
228
	if [ $Lang == "fr" ]
230
		then echo -n "Tests des paramètres réseau : "
229
		then echo -n "Tests des paramètres réseau : "
231
		else echo -n "Network parameters tests : "
230
		else echo -n "Network parameters tests : "
232
	fi
231
	fi
233
# Test of Ethernet links state
232
# Test of Ethernet links state
234
	DOWN_IF=`/sbin/ip link|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "`
233
	DOWN_IF=`/usr/sbin/ip link|grep "NO-CARRIER"|cut -d":" -f2|tr -d " "`
235
	for i in $DOWN_IF
234
	for i in $DOWN_IF
236
	do
235
	do
237
		if [ $Lang == "fr" ]
236
		if [ $Lang == "fr" ]
238
		then 
237
		then 
239
			echo "Échec"
238
			echo "Échec"
Line 375... Line 374...
375
	echo "$secretuam" >> $PASSWD_FILE
374
	echo "$secretuam" >> $PASSWD_FILE
376
	secretradius=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
375
	secretradius=`cat /dev/urandom | tr -dc [:alnum:] | head -c8`
377
	echo -n "Shared secret between coova-chilli and FreeRadius : " >> $PASSWD_FILE
376
	echo -n "Shared secret between coova-chilli and FreeRadius : " >> $PASSWD_FILE
378
	echo "$secretradius" >> $PASSWD_FILE
377
	echo "$secretradius" >> $PASSWD_FILE
379
	chmod 640 $PASSWD_FILE
378
	chmod 640 $PASSWD_FILE
380
# Scripts and conf files copy 
379
#  copy scripts in in /usr/local/bin
381
#  - in /usr/local/bin :  alcasar-{CA.sh,conf.sh,import-clean.sh,iptables-bypass.sh,iptables.sh,log.sh,watchdog.sh}
-
 
382
	cp -f $DIR_SCRIPTS/alcasar* $DIR_DEST_BIN/. ; chown root:root $DIR_DEST_BIN/alcasar* ; chmod 740 $DIR_DEST_BIN/alcasar*
380
	cp -f $DIR_SCRIPTS/alcasar* $DIR_DEST_BIN/. ; chown root:root $DIR_DEST_BIN/alcasar* ; chmod 740 $DIR_DEST_BIN/alcasar*
383
#  - in /usr/local/sbin :  alcasar-{bl.sh,bypass.sh,dateLog.sh,havp.sh,logout.sh,mysql.sh,nf.sh,profil.sh,uninstall.sh,version-list.sh,load-balancing.sh}
-
 
384
	cp -f $DIR_SCRIPTS/sbin/alcasar* $DIR_DEST_SBIN/. ; chown root:root $DIR_DEST_SBIN/alcasar* ; chmod 740 $DIR_DEST_SBIN/alcasar*
-
 
385
#  - in /usr/local/etc : alcasar-{bl-categories-enabled,dns-name,iptables-local.sh,services}
381
#  copy conf files in /usr/local/etc
386
	cp -f $DIR_CONF/etc/alcasar* $DIR_DEST_ETC/. ; chown root:apache $DIR_DEST_ETC/alcasar* ; chmod 660 $DIR_DEST_ETC/alcasar*
382
	cp -f $DIR_CONF/etc/alcasar* $DIR_DEST_ETC/. ; chown root:apache $DIR_DEST_ETC/alcasar* ; chmod 660 $DIR_DEST_ETC/alcasar*
387
	$SED "s?^radiussecret.*?radiussecret=\"$secretradius\"?g" $DIR_DEST_SBIN/alcasar-logout.sh
383
	$SED "s?^radiussecret.*?radiussecret=\"$secretradius\"?g" $DIR_DEST_BIN/alcasar-logout.sh
388
	$SED "s?^DB_RADIUS=.*?DB_RADIUS=\"$DB_RADIUS\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh
384
	$SED "s?^DB_RADIUS=.*?DB_RADIUS=\"$DB_RADIUS\"?g" $DIR_DEST_BIN/alcasar-mysql.sh
389
	$SED "s?^DB_USER=.*?DB_USER=\"$DB_USER\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
385
	$SED "s?^DB_USER=.*?DB_USER=\"$DB_USER\"?g" $DIR_DEST_BIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
390
	$SED "s?^radiuspwd=.*?radiuspwd=\"$radiuspwd\"?g" $DIR_DEST_SBIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
386
	$SED "s?^radiuspwd=.*?radiuspwd=\"$radiuspwd\"?g" $DIR_DEST_BIN/alcasar-mysql.sh $DIR_DEST_BIN/alcasar-conf.sh
391
# generate central conf file
387
# generate central conf file
392
	cat <<EOF > $CONF_FILE
388
	cat <<EOF > $CONF_FILE
393
##########################################
389
##########################################
394
##                                      ##
390
##                                      ##
395
##          ALCASAR Parameters          ##
391
##          ALCASAR Parameters          ##
Line 471... Line 467...
471
	PRIVATE_NETWORK_SHORT=`echo $PRIVATE_NETWORK | cut -d"." -f1-$classe`.				# compatibility with hosts.allow et hosts.deny (ie.: 192.168.182.)
467
	PRIVATE_NETWORK_SHORT=`echo $PRIVATE_NETWORK | cut -d"." -f1-$classe`.				# compatibility with hosts.allow et hosts.deny (ie.: 192.168.182.)
472
	PRIVATE_BROADCAST=`/bin/ipcalc -b $PRIVATE_NETWORK_MASK | cut -d"=" -f2`			# private network broadcast (ie.: 192.168.182.255)
468
	PRIVATE_BROADCAST=`/bin/ipcalc -b $PRIVATE_NETWORK_MASK | cut -d"=" -f2`			# private network broadcast (ie.: 192.168.182.255)
473
	private_broadcast_ending=`echo $PRIVATE_BROADCAST | cut -d"." -f4`				# last octet of LAN broadcast
469
	private_broadcast_ending=`echo $PRIVATE_BROADCAST | cut -d"." -f4`				# last octet of LAN broadcast
474
	PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1`	# First network address (ex.: 192.168.182.1)
470
	PRIVATE_FIRST_IP=`echo $PRIVATE_NETWORK | cut -d"." -f1-3`"."`expr $private_network_ending + 1`	# First network address (ex.: 192.168.182.1)
475
	PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1`	# last network address (ex.: 192.168.182.254)
471
	PRIVATE_LAST_IP=`echo $PRIVATE_BROADCAST | cut -d"." -f1-3`"."`expr $private_broadcast_ending - 1`	# last network address (ex.: 192.168.182.254)
476
	PRIVATE_MAC=`/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` 	# MAC address of INTIF
472
	PRIVATE_MAC=`/usr/sbin/ip link show $INTIF | grep ether | cut -d" " -f6| sed 's/:/-/g'| awk '{print toupper($0)}'` 	# MAC address of INTIF
477
# Define Internet parameters
473
# Define Internet parameters
478
	DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1`				# 1st DNS server
474
	DNS1=`grep ^nameserver /etc/resolv.conf|awk -F" " '{print $2}'|head -n 1`				# 1st DNS server
479
	nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
475
	nb_dns=`grep ^nameserver /etc/resolv.conf|wc -l`
480
	if [ $nb_dns == 2 ]
476
	if [ $nb_dns == 2 ]
481
		then
477
		then
Line 774... Line 770...
774
		chmod 755 $DIR_DEST_ETC/digest
770
		chmod 755 $DIR_DEST_ETC/digest
775
		until [ -s $DIR_DEST_ETC/digest/key_admin ]
771
		until [ -s $DIR_DEST_ETC/digest/key_admin ]
776
			do
772
			do
777
				/usr/bin/htdigest -c $DIR_DEST_ETC/digest/key_admin "ALCASAR Control Center (ACC)" $admin_portal
773
				/usr/bin/htdigest -c $DIR_DEST_ETC/digest/key_admin "ALCASAR Control Center (ACC)" $admin_portal
778
			done
774
			done
779
		$DIR_DEST_SBIN/alcasar-profil.sh --list
775
		$DIR_DEST_BIN/alcasar-profil.sh --list
780
# !! remove if > V2.9.2
776
# !! remove if > V2.9.2
781
# fi
777
# fi
782
 
778
 
783
# synchronisation horaire
779
# synchronisation horaire
784
	ntpd -q -g &
780
	ntpd -q -g &
Line 926... Line 922...
926
	$MYSQL="CREATE DATABASE IF NOT EXISTS $DB_RADIUS;GRANT ALL ON $DB_RADIUS.* TO $DB_USER@localhost IDENTIFIED BY '$radiuspwd';FLUSH PRIVILEGES;"
922
	$MYSQL="CREATE DATABASE IF NOT EXISTS $DB_RADIUS;GRANT ALL ON $DB_RADIUS.* TO $DB_USER@localhost IDENTIFIED BY '$radiuspwd';FLUSH PRIVILEGES;"
927
# Add an empty radius database structure
923
# Add an empty radius database structure
928
	mysql -u$DB_USER -p$radiuspwd $DB_RADIUS < $DIR_CONF/empty-radiusd-db.sql
924
	mysql -u$DB_USER -p$radiuspwd $DB_RADIUS < $DIR_CONF/empty-radiusd-db.sql
929
# modify the start script in order to close accounting connexion when the system is comming down or up
925
# modify the start script in order to close accounting connexion when the system is comming down or up
930
	[ -e /lib/systemd/system/mysqld.service.default ] || cp /lib/systemd/system/mysqld.service /lib/systemd/system/mysqld.service.default
926
	[ -e /lib/systemd/system/mysqld.service.default ] || cp /lib/systemd/system/mysqld.service /lib/systemd/system/mysqld.service.default
931
	$SED "/ExecStartPost=/a ExecStop=/usr/local/sbin/alcasar-mysql.sh -acct_stop" /usr/lib/systemd/system/mysqld.service
927
	$SED "/ExecStartPost=/a ExecStop=$DIR_DEST_BIN/alcasar-mysql.sh -acct_stop" /usr/lib/systemd/system/mysqld.service
932
	$SED "/ExecStartPost=/a ExecStartPost=/usr/local/sbin/alcasar-mysql.sh -acct_stop" /lib/systemd/system/mysqld.service
928
	$SED "/ExecStartPost=/a ExecStartPost=$DIR_DEST_BIN/alcasar-mysql.sh -acct_stop" /lib/systemd/system/mysqld.service
933
	/usr/bin/systemctl daemon-reload
929
	/usr/bin/systemctl daemon-reload
934
} # End of init_db ()
930
} # End of init_db ()
935
 
931
 
936
##########################################################################
932
##########################################################################
937
##			Fonction "radius"				##
933
##			Fonction "radius"				##
Line 1126... Line 1122...
1126
	if [ -f \$pidfile ] ; then 
1122
	if [ -f \$pidfile ] ; then 
1127
		gprintf "chilli is already running"
1123
		gprintf "chilli is already running"
1128
	else
1124
	else
1129
        	gprintf "Starting \$prog: "
1125
        	gprintf "Starting \$prog: "
1130
		rm -f /var/run/chilli* # cleaning
1126
		rm -f /var/run/chilli* # cleaning
1131
        	/sbin/modprobe tun >/dev/null 2>&1
1127
        	/usr/sbin/modprobe tun >/dev/null 2>&1
1132
        	echo 1 > /proc/sys/net/ipv4/ip_forward
1128
        	echo 1 > /proc/sys/net/ipv4/ip_forward
1133
		[ -e /dev/net/tun ] || {
1129
		[ -e /dev/net/tun ] || {
1134
	    	(cd /dev; 
1130
	    	(cd /dev; 
1135
			mkdir net; 
1131
			mkdir net; 
1136
			cd net; 
1132
			cd net; 
Line 1673... Line 1669...
1673
EOF
1669
EOF
1674
# change the the google safesearch ("safe=strict" instead of "safe=vss")
1670
# change the the google safesearch ("safe=strict" instead of "safe=vss")
1675
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1671
	$SED "s?safe=vss?safe=strict?g" $DIR_DG/lists/urlregexplist
1676
# adapt the BL to ALCASAR architecture. Enable the default categories
1672
# adapt the BL to ALCASAR architecture. Enable the default categories
1677
	if [ "$mode" != "update" ]; then
1673
	if [ "$mode" != "update" ]; then
1678
		$DIR_DEST_SBIN/alcasar-bl.sh --adapt
1674
		$DIR_DEST_BIN/alcasar-bl.sh --adapt
1679
		$DIR_DEST_SBIN/alcasar-bl.sh --cat_choice
1675
		$DIR_DEST_BIN/alcasar-bl.sh --cat_choice
1680
	fi
1676
	fi
1681
}
1677
}
1682
 
1678
 
1683
##########################################################
1679
##########################################################
1684
##		Fonction "cron"				##
1680
##		Fonction "cron"				##
Line 1687... Line 1683...
1687
cron ()
1683
cron ()
1688
{
1684
{
1689
# Modif du fichier 'crontab' pour passer les cron à minuit au lieu de 04h00
1685
# Modif du fichier 'crontab' pour passer les cron à minuit au lieu de 04h00
1690
	[ -e /etc/crontab.default ] || cp /etc/crontab /etc/crontab.default
1686
	[ -e /etc/crontab.default ] || cp /etc/crontab /etc/crontab.default
1691
	cat <<EOF > /etc/crontab
1687
	cat <<EOF > /etc/crontab
1692
SHELL=/bin/bash
1688
SHELL=/usr/bin/bash
1693
PATH=/sbin:/bin:/usr/sbin:/usr/bin
1689
PATH=/usr/sbin:/usr/bin
1694
MAILTO=root
1690
MAILTO=root
1695
HOME=/
1691
HOME=/
1696
 
1692
 
1697
# run-parts
1693
# run-parts
1698
01 * * * * root nice -n 19 run-parts --report /etc/cron.hourly
1694
01 * * * * root nice -n 19 run-parts --report /etc/cron.hourly
Line 1707... Line 1703...
1707
7	20	cron.importClean	nice /etc/cron.d/alcasar-clean_import
1703
7	20	cron.importClean	nice /etc/cron.d/alcasar-clean_import
1708
EOF
1704
EOF
1709
 
1705
 
1710
	cat <<EOF > /etc/cron.d/alcasar-mysql
1706
	cat <<EOF > /etc/cron.d/alcasar-mysql
1711
# Contrôle, réparation et export de la base des usagers (tous les lundi à 4h45)
1707
# Contrôle, réparation et export de la base des usagers (tous les lundi à 4h45)
1712
45 4 * * 1 root $DIR_DEST_SBIN/alcasar-mysql.sh --dump
1708
45 4 * * 1 root $DIR_DEST_BIN/alcasar-mysql.sh --dump
1713
# Nettoyage des utilisateurs dont la date d'expiration du compte est supérieure à 7 jours
1709
# Nettoyage des utilisateurs dont la date d'expiration du compte est supérieure à 7 jours
1714
40 4 * * * root /usr/local/sbin/alcasar-mysql.sh --expire_user 2>&1 >/dev/null
1710
40 4 * * * root $DIR_DEST_BIN/alcasar-mysql.sh --expire_user 2>&1 >/dev/null
1715
EOF
1711
EOF
1716
	cat <<EOF > /etc/cron.d/alcasar-archive
1712
	cat <<EOF > /etc/cron.d/alcasar-archive
1717
# Archive des logs et de la base de données (tous les lundi à 5h35)
1713
# Archive des logs et de la base de données (tous les lundi à 5h35)
1718
35 5 * * 1 root $DIR_DEST_BIN/alcasar-archive.sh --now
1714
35 5 * * 1 root $DIR_DEST_BIN/alcasar-archive.sh --now
1719
EOF
1715
EOF
Line 1806... Line 1802...
1806
user = $DB_USER
1802
user = $DB_USER
1807
password = $radiuspwd
1803
password = $radiuspwd
1808
pc = localhost
1804
pc = localhost
1809
database = $DB_GAMMU
1805
database = $DB_GAMMU
1810
 
1806
 
1811
RunOnReceive = /usr/local/bin/alcasar-sms.sh --new_sms
1807
RunOnReceive = $DIR_DEST_BIN/alcasar-sms.sh --new_sms
1812
 
1808
 
1813
StatusFrequency = 30
1809
StatusFrequency = 30
1814
;LoopSleep = 2
1810
;LoopSleep = 2
1815
 
1811
 
1816
;ResetFrequency = 300
1812
;ResetFrequency = 300
Line 1831... Line 1827...
1831
$SED "s/^u_db=\".*/u_db=\"$DB_USER\"/g" $DIR_DEST_BIN/alcasar-sms.sh
1827
$SED "s/^u_db=\".*/u_db=\"$DB_USER\"/g" $DIR_DEST_BIN/alcasar-sms.sh
1832
$SED "s/^p_db=\".*/p_db=\"$radiuspwd\"/g" $DIR_DEST_BIN/alcasar-sms.sh
1828
$SED "s/^p_db=\".*/p_db=\"$radiuspwd\"/g" $DIR_DEST_BIN/alcasar-sms.sh
1833
 
1829
 
1834
#Création de la règle udev pour les Huawei // idVendor: 12d1
1830
#Création de la règle udev pour les Huawei // idVendor: 12d1
1835
cat << EOF > /etc/udev/rules.d/66-huawei.rules
1831
cat << EOF > /etc/udev/rules.d/66-huawei.rules
1836
KERNEL=="ttyUSB0",ATTRS{idVendor}=="12d1",RUN+="/usr/local/bin/alcasar-sms.sh --mode"
1832
KERNEL=="ttyUSB0",ATTRS{idVendor}=="12d1",RUN+="$DIR_DEST_BIN/alcasar-sms.sh --mode"
1837
EOF
1833
EOF
1838
 
1834
 
1839
} # END gammu_smsd()
1835
} # END gammu_smsd()
1840
 
1836
 
1841
##################################################################
1837
##################################################################
Line 1908... Line 1904...
1908
After=network.target iptables.service
1904
After=network.target iptables.service
1909
 
1905
 
1910
[Service]
1906
[Service]
1911
Type=oneshot
1907
Type=oneshot
1912
RemainAfterExit=yes
1908
RemainAfterExit=yes
1913
ExecStart=/usr/local/sbin/alcasar-load_balancing.sh start
1909
ExecStart=$DIR_DEST_BIN/alcasar-load_balancing.sh start
1914
ExecStop=/usr/local/sbin/alcasar-load_balancing.sh stop
1910
ExecStop=$DIR_DEST_BIN/alcasar-load_balancing.sh stop
1915
TimeoutSec=0
1911
TimeoutSec=0
1916
SysVStartPriority=99
1912
SysVStartPriority=99
1917
 
1913
 
1918
[Install]
1914
[Install]
1919
WantedBy=multi-user.target
1915
WantedBy=multi-user.target
Line 2071... Line 2067...
2071
			exit 0
2067
			exit 0
2072
		fi
2068
		fi
2073
		if [ -e $CONF_FILE ]
2069
		if [ -e $CONF_FILE ]
2074
		then
2070
		then
2075
# Uninstall the running version
2071
# Uninstall the running version
2076
			$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
2072
			$DIR_SCRIPTS/alcasar-uninstall.sh
2077
		fi
2073
		fi
2078
# Test if manual update	
2074
# Test if manual update	
2079
		if [ -e /tmp/alcasar-conf*.tar.gz ] && [ "$mode" == "install" ]
2075
		if [ -e /tmp/alcasar-conf*.tar.gz ] && [ "$mode" == "install" ]
2080
		then
2076
		then
2081
			header_install
2077
			header_install
Line 2118... Line 2114...
2118
			$func
2114
			$func
2119
# echo "*** 'debug' : end of function $func ***"; read a
2115
# echo "*** 'debug' : end of function $func ***"; read a
2120
		done
2116
		done
2121
		;;
2117
		;;
2122
	-u | --uninstall)
2118
	-u | --uninstall)
2123
		if [ ! -e $DIR_DEST_SBIN/alcasar-uninstall.sh ]
2119
		if [ ! -e $DIR_DEST_BIN/alcasar-uninstall.sh ]
2124
		then
2120
		then
2125
			if [ $Lang == "fr" ]
2121
			if [ $Lang == "fr" ]
2126
				then echo "ALCASAR n'est pas installé!";
2122
				then echo "ALCASAR n'est pas installé!";
2127
				else echo "ALCASAR isn't installed!";
2123
				else echo "ALCASAR isn't installed!";
2128
			fi
2124
			fi
Line 2143... Line 2139...
2143
			$DIR_SCRIPTS/alcasar-conf.sh --create
2139
			$DIR_SCRIPTS/alcasar-conf.sh --create
2144
		else	
2140
		else	
2145
			rm -f /tmp/alcasar-conf*
2141
			rm -f /tmp/alcasar-conf*
2146
		fi
2142
		fi
2147
# Uninstall the running version
2143
# Uninstall the running version
2148
		$DIR_SCRIPTS/sbin/alcasar-uninstall.sh
2144
		$DIR_SCRIPTS/alcasar-uninstall.sh
2149
		;;
2145
		;;
2150
	*)
2146
	*)
2151
		echo "Argument inconnu :$1";
2147
		echo "Argument inconnu :$1";
2152
		echo "Unknown argument :$1";
2148
		echo "Unknown argument :$1";
2153
		echo "$usage"
2149
		echo "$usage"