Subversion Repositories ALCASAR

Rev

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

Rev Author Line No. Line
843 richard 1
#/bin/bash
958 franck 2
# $Id: alcasar-https.sh 1803 2016-02-29 21:30:57Z richard $
843 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
1803 richard 30
		$SED "s?uamserver.*?uamserver\thttp://alcasar.localdomain/intercept.php?" $CHILLI_CONF_FILE
1617 richard 31
		/usr/bin/systemctl restart chilli
843 richard 32
		;;
33
	--on|-on) # enable HTTPS
34
		$SED "/## If https not use/,/#}/s?^#??" $INTERCEPT_FILE
1803 richard 35
		$SED "s?uamserver.*?uamserver\thttps://alcasar.localdomain/intercept.php?" $CHILLI_CONF_FILE
1617 richard 36
		/usr/bin/systemctl restart chilli
843 richard 37
		;;
38
	*)
39
		echo "Argument inconnu :$1";
40
		echo "$usage"
41
		exit 1
42
		;;
43
esac
44