Subversion Repositories ALCASAR

Rev

Rev 2454 | Rev 2879 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2454 Rev 2592
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-https.sh 2454 2017-12-09 18:59:31Z tom.houdayer $
2
# $Id: alcasar-https.sh 2592 2018-08-18 22:09:42Z rexy $
3
 
3
 
4
# alcasar-dhcp.sh
4
# alcasar-dhcp.sh
5
# by Rexy
5
# by Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 29... Line 29...
29
		exit 0
29
		exit 0
30
		;;
30
		;;
31
	--off | -off)	# disable HTTPS
31
	--off | -off)	# disable HTTPS
32
		$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=off?" $CONF_FILE
32
		$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=off?" $CONF_FILE
33
		$SED "s?^HTTPS_CHILLI=.*?HTTPS_CHILLI=off?" $CONF_FILE
33
		$SED "s?^HTTPS_CHILLI=.*?HTTPS_CHILLI=off?" $CONF_FILE
34
		$SED "s?uamserver.*?uamserver\thttp://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
34
		$SED "s?^uamserver.*?uamserver\thttp://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
-
 
35
		$SED "s?^redirssl.*?#&?" $CHILLI_CONF_FILE
-
 
36
		$SED "s?^uamuissl.*?#&?" $CHILLI_CONF_FILE
35
		/usr/bin/systemctl restart chilli
37
		/usr/bin/systemctl restart chilli
-
 
38
		rm -f /etc/lighttpd/vhosts.d/alcasar.conf
-
 
39
		ln -s /etc/lighttpd/vhosts.d/alcasar-without-ssl.conf /etc/lighttpd/vhosts.d/alcasar.conf
-
 
40
		/usr/bin/systemctl restart lighttpd
36
		;;
41
		;;
37
	--on | -on)	# enable HTTPS
42
	--on | -on)	# enable HTTPS
38
		$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=on?" $CONF_FILE
43
		$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=on?" $CONF_FILE
39
		$SED "s?uamserver.*?uamserver\thttps://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
44
		$SED "s?^uamserver.*?uamserver\thttps://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
-
 
45
		$SED "s?^#redirssl.*?redirssl?" $CHILLI_CONF_FILE
-
 
46
		$SED "s?^#uamuissl.*?uamuissl?" $CHILLI_CONF_FILE
40
		/usr/bin/systemctl restart chilli
47
		/usr/bin/systemctl restart chilli
-
 
48
		rm -f /etc/lighttpd/vhosts.d/alcasar.conf
-
 
49
		ln -s /etc/lighttpd/vhosts.d/alcasar-with-ssl.conf /etc/lighttpd/vhosts.d/alcasar.conf
-
 
50
		/usr/bin/systemctl restart lighttpd
41
		;;
51
		;;
42
	*)
52
	*)
43
		echo "Argument inconnu : $1"
53
		echo "Argument inconnu : $1"
44
		echo "$usage"
54
		echo "$usage"
45
		exit 1
55
		exit 1