Subversion Repositories ALCASAR

Rev

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

Rev 2879 Rev 2920
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-https.sh 2879 2020-11-02 22:27:16Z rexy $
2
# $Id: alcasar-https.sh 2920 2021-02-22 09:56:30Z 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 26... Line 26...
26
case $args in
26
case $args in
27
	-\? | -h* | --h*)
27
	-\? | -h* | --h*)
28
		echo "$usage"
28
		echo "$usage"
29
		exit 0
29
		exit 0
30
		;;
30
		;;
31
	--off | -off)	# disable HTTPS
31
	--off | -off)	# Chilli : disable HTTPS (it will listen only on 3990 port) + lighttpd : switch with an HTTP conf file
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
35
		$SED "s?^redirssl.*?#&?" $CHILLI_CONF_FILE
36
		$SED "s?^uamuissl.*?#&?" $CHILLI_CONF_FILE
36
		$SED "s?^uamuissl.*?#&?" $CHILLI_CONF_FILE
37
		/usr/bin/systemctl restart chilli
37
		/usr/bin/systemctl restart chilli
38
		rm -f /etc/lighttpd/vhosts.d/alcasar.conf
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
39
		ln -s /etc/lighttpd/vhosts.d/alcasar-without-ssl.conf /etc/lighttpd/vhosts.d/alcasar.conf
40
		/usr/bin/systemctl restart lighttpd
40
		/usr/bin/systemctl restart lighttpd
41
		;;
41
		;;
42
	--on | -on)	# enable HTTPS
42
	--on | -on)	# Chilli : enable HTTPS (it will listen on ports 3990 (http) and 3991 (https) + lighttpd : switch with an HTTPS conf file
43
		$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=on?" $CONF_FILE
43
		$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=on?" $CONF_FILE
44
		$SED "s?^HTTPS_CHILLI=.*?HTTPS_CHILLI=on?" $CONF_FILE
44
		$SED "s?^HTTPS_CHILLI=.*?HTTPS_CHILLI=on?" $CONF_FILE
45
		$SED "s?^uamserver.*?uamserver\thttps://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
45
		$SED "s?^uamserver.*?uamserver\thttps://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
46
		$SED "s?^#redirssl.*?redirssl?" $CHILLI_CONF_FILE
46
		$SED "s?^#redirssl.*?redirssl?" $CHILLI_CONF_FILE
47
		$SED "s?^#uamuissl.*?uamuissl?" $CHILLI_CONF_FILE
47
		$SED "s?^#uamuissl.*?uamuissl?" $CHILLI_CONF_FILE