Subversion Repositories ALCASAR

Rev

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

Rev 2223 Rev 2412
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-logout.sh 2223 2017-05-14 14:38:01Z tom.houdayer $
2
# $Id: alcasar-logout.sh 2412 2017-09-17 12:11:23Z tom.houdayer $
3
 
3
 
4
# alcasar-logout.sh
4
# alcasar-logout.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
 
8
# Déconnexion d'un ou de tous les usagers
8
# Déconnexion d'un ou de tous les usagers
9
# Logout one user (or all users)
9
# Logout one user (or all users)
10
 
10
 
11
radiussecret=""
11
PASSWD_FILE="/root/ALCASAR-passwords.txt"
-
 
12
RADIUS_SECRET=$(grep '^secret_radius=' $PASSWD_FILE | cut -d'=' -f 2-)
12
OLDIFS=$IFS
13
OLDIFS=$IFS
13
IFS=$'\n'
14
IFS=$'\n'
14
 
15
 
15
usage="Usage: alcasar-logout.sh {user_name} | {all}"
16
usage="Usage: alcasar-logout.sh {user_name} | {all}"
16
nb_args=$#
17
nb_args=$#
Line 45... Line 46...
45
			fi
46
			fi
46
		done
47
		done
47
		echo "All users are now logout : ($logout_users)"
48
		echo "All users are now logout : ($logout_users)"
48
		;;
49
		;;
49
	*)
50
	*)
50
		echo "User-Name = $args" | /usr/bin/radclient 127.0.0.1:3799 40 $radiussecret
51
		echo "User-Name = $args" | /usr/bin/radclient 127.0.0.1:3799 40 $RADIUS_SECRET
51
		;;
52
		;;
52
esac
53
esac
53
IFS=$OLDIFS
54
IFS=$OLDIFS
54
 
55