Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 2324 → Rev 2323

/scripts/alcasar-https.sh
9,10 → 9,8
# enable or disable encryption on authentication flows
 
SED="/bin/sed -i"
CONF_FILE="/usr/local/etc/alcasar.conf"
CHILLI_CONF_FILE="/etc/chilli.conf"
HOSTNAME=$(grep ^HOSTNAME= $CONF_FILE | cut -d'=' -f2)
DOMAIN=$(grep ^DOMAIN= $CONF_FILE | cut -d'=' -f2)
INTERCEPT_FILE="/var/www/html/intercept.php"
 
usage="Usage: alcasar-https.sh {--on | -on} | {--off | -off}"
nb_args=$#
22,7 → 20,6
echo "$usage"
exit 1
fi
 
case $args in
-\? | -h* | --h*)
echo "$usage"
29,18 → 26,19
exit 0
;;
--off | -off) # disable HTTPS
$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=off?" $CONF_FILE
$SED "s?uamserver.*?uamserver\thttp://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
$SED "/# If https not use/,/}/s?^?#?" $INTERCEPT_FILE
$SED "s?uamserver.*?uamserver\thttp://alcasar.localdomain/intercept.php?" $CHILLI_CONF_FILE
/usr/bin/systemctl restart chilli
;;
--on | -on) # enable HTTPS
$SED "s?^HTTPS_LOGIN=.*?HTTPS_LOGIN=on?" $CONF_FILE
$SED "s?uamserver.*?uamserver\thttps://$HOSTNAME.$DOMAIN/intercept.php?" $CHILLI_CONF_FILE
$SED "/## If https not use/,/#}/s?^#??" $INTERCEPT_FILE
$SED "s?uamserver.*?uamserver\thttps://alcasar.localdomain/intercept.php?" $CHILLI_CONF_FILE
/usr/bin/systemctl restart chilli
;;
*)
echo "Argument inconnu : $1"
echo "Argument inconnu :$1";
echo "$usage"
exit 1
;;
esac