Subversion Repositories ALCASAR

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
2931 rexy 1
#!/bin/bash
2
 
3
# alcasar-wifi4eu.sh
4
# by Rexy
5
# This script is distributed under the Gnu General Public License (GPL)
6
 
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)
9
 
10
SED="/bin/sed -i"
11
CONF_FILE="/usr/local/etc/alcasar.conf"
12
HOSTNAME=$(grep ^HOSTNAME= $CONF_FILE | cut -d'=' -f2)
13
DOMAIN=$(grep ^DOMAIN= $CONF_FILE | cut -d'=' -f2)
14
 
15
usage="Usage: alcasar-wifi4eu.sh {--on | -on} | {--off | -off}"
16
nb_args=$#
17
args=$1
18
if [ $nb_args -eq 0 ]
19
then
20
	echo "$usage"
21
	exit 1
22
fi
23
 
24
case $args in
25
	-\? | -h* | --h*)
26
		echo "$usage"
27
		exit 0
28
		;;
29
	--off | -off)
30
		$SED "s?^WIFI4EU=.*?WIFI4EU=off?" $CONF_FILE
31
		;;
32
	--on | -on)
33
		$SED "s?^WIFI4EU=.*?WIFI4EU=on?" $CONF_FILE
34
		;;
35
	*)
36
		echo "Argument inconnu : $1"
37
		echo "$usage"
38
		exit 1
39
		;;
40
esac