Subversion Repositories ALCASAR

Rev

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

Rev Author Line No. Line
2447 richard 1
#!/bin/bash
2
 
3
# alcasar-ldap.sh
4
# by Rexy
5
# This script is distributed under the Gnu General Public License (GPL)
6
 
7
# activation / désactivation de l'authentification des utilisateurs via un serveur LDAP externe
8
# enable / disable authentication of users via an extern LDAP server
9
 
10
# TODO
11
#		- modif files "site-enabled/alcasar" + "mods-available/ldap"
12
#		- add / remove "ln -s mods-available/ldap mods-enabled/ldap"
13
#       - /usr/local/bin/alcasar-iptables.sh");
14
#       - /usr/bin/systemctl restart radiusd");
15
 
16
# Modif "sites-enabled/alcasar"
17
#	Configure autorize section with:
18
#		ldap  { 
19
#			fail=1
20
#		}
21
#	Configure authenticate section with
22
#		Auth-Type LDAP {
23
#			ldap
24
#		}
25
 
26
# Modif "mods-available/ldap"
27
#	host = $ldap_server;
28
#	identity = $ldap_user;
29
#	password = $ldap_password;
30
#	basedn = $ldap_base_dn;
31
#	filter = $ldap_filter;
32
#	uid = $ldap_filter;
33
#	base_filter = $ldap_base_filter;
34
 
35
usage="Usage: alcasar-ldap.sh {--on or -on } | {--off or -off}"
36
SED="/bin/sed -i"
37
CONF_FILE="/usr/local/etc/alcasar.conf"
38
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2`				# INTernal InterFace
39
 
40
nb_args=$#
41
args=$1
42
if [ $nb_args -eq 0 ]
43
then
44
	nb_args=1
45
	args="-h"
46
fi
47
case $args in
48
	-\? | -h* | --h*)
49
		echo "$usage"
50
		exit 0
51
		;;
52
	--on | -on)	
53
		;;
54
	--off | -off)
55
;;
56
	*)
57
		echo "Argument inconnu :$1";
58
		echo "$usage"
59
		exit 1
60
		;;
61
esac