Subversion Repositories ALCASAR

Rev

Rev 2931 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2931 Rev 2934
Line 7... Line 7...
7
# active ou désactive l'affichage du logo WIFI4EU (+ intégration de leur échantillon de code)
7
# active ou désactive l'affichage du logo WIFI4EU (+ intégration de leur échantillon de code)
8
# enable or disable the display of WIFI4EU logo (+ integration of their snippet)
8
# enable or disable the display of WIFI4EU logo (+ integration of their snippet)
9
 
9
 
10
SED="/bin/sed -i"
10
SED="/bin/sed -i"
11
CONF_FILE="/usr/local/etc/alcasar.conf"
11
CONF_FILE="/usr/local/etc/alcasar.conf"
-
 
12
TRUST_SITES_FILE='/usr/local/etc/alcasar-uamdomain'
-
 
13
TRUST_DOMAIN='collection.wifi4eu.ec.europa.eu' # the web site where the snippet connects to
12
HOSTNAME=$(grep ^HOSTNAME= $CONF_FILE | cut -d'=' -f2)
14
HOSTNAME=$(grep ^HOSTNAME= $CONF_FILE | cut -d'=' -f2)
13
DOMAIN=$(grep ^DOMAIN= $CONF_FILE | cut -d'=' -f2)
15
DOMAIN=$(grep ^DOMAIN= $CONF_FILE | cut -d'=' -f2)
14
 
16
 
15
usage="Usage: alcasar-wifi4eu.sh {--on | -on} | {--off | -off}"
17
usage="Usage: alcasar-wifi4eu.sh {--on | -on} | {--off | -off}"
16
nb_args=$#
18
nb_args=$#
Line 26... Line 28...
26
		echo "$usage"
28
		echo "$usage"
27
		exit 0
29
		exit 0
28
		;;
30
		;;
29
	--off | -off)
31
	--off | -off)
30
		$SED "s?^WIFI4EU=.*?WIFI4EU=off?" $CONF_FILE
32
		$SED "s?^WIFI4EU=.*?WIFI4EU=off?" $CONF_FILE
-
 
33
		$SED "/$TRUST_DOMAIN/d" $TRUST_SITES_FILE
-
 
34
		/usr/local/bin/alcasar-file-clean.sh # Clean & sort conf files.
-
 
35
		/usr/bin/systemctl restart chilli
31
		;;
36
		;;
32
	--on | -on)
37
	--on | -on)
33
		$SED "s?^WIFI4EU=.*?WIFI4EU=on?" $CONF_FILE
38
		$SED "s?^WIFI4EU=.*?WIFI4EU=on?" $CONF_FILE
-
 
39
		echo "uamdomain=\"$TRUST_DOMAIN\"" >> $TRUST_SITES_FILE
-
 
40
		/usr/local/bin/alcasar-file-clean.sh # Clean & sort conf files.
-
 
41
		/usr/bin/systemctl restart chilli
34
		;;
42
		;;
35
	*)
43
	*)
36
		echo "Argument inconnu : $1"
44
		echo "Argument inconnu : $1"
37
		echo "$usage"
45
		echo "$usage"
38
		exit 1
46
		exit 1