Subversion Repositories ALCASAR

Rev

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

Rev Author Line No. Line
843 richard 1
#/bin/bash
2
# $Id: alcasar-nf.sh 791 2012-01-13 21:31:36Z richard $
3
 
4
# alcasar-dhcp.sh
5
# by Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
8
# active ou d├ęsactive le chiffrement sur les flux d'authentification
9
# enable or disable encryption on authentication flows
10
 
11
SED="/bin/sed -i"
12
CHILLI_CONF_FILE="/etc/chilli.conf"
13
INTERCEPT_FILE="/var/www/html/intercept.php"
14
 
15
usage="Usage: alcasar-https.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
case $args in
24
	-\? | -h* | --h*)
25
		echo "$usage"
26
		exit 0
27
		;;
28
	--off|-off) # disable HTTPS 
29
		$SED "/# If https not use/,/}/s?^?#?" $INTERCEPT_FILE
30
		$SED "s?uamserver.*?uamserver\thttp://alcasar/intercept.php?" $CHILLI_CONF_FILE
31
		/etc/init.d/chilli restart
32
		;;
33
	--on|-on) # enable HTTPS
34
		$SED "/## If https not use/,/#}/s?^#??" $INTERCEPT_FILE
35
		$SED "s?uamserver.*?uamserver\thttps://alcasar/intercept.php?" $CHILLI_CONF_FILE
36
		/etc/init.d/chilli restart
37
		;;
38
	*)
39
		echo "Argument inconnu :$1";
40
		echo "$usage"
41
		exit 1
42
		;;
43
esac
44