summaryrefslogtreecommitdiff
path: root/deploy/pptpd/pptpd_install/auth-up
blob: d8a2c75b83e1f08ad3793440d85babdf8fe4dabd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# get the username from the parameters
USER=$2
# if there is a session already for this user, terminate the old one

mkdir -p /var/run/ppp/current_user/

PPID=`awk '/PPid/ { print $2; }' /proc/$$/status`

if [ -f /var/run/ppp/current_user/$USER ]; then
	echo $2 already access success, exit, pid:$$, ppid:$PPID >> /var/run/ppp/user_access.log
	kill -9 $PPID
else
	echo $2 > /var/run/ppp/current_user/$USER
	echo $2 dial up success! >> /var/run/ppp/user_access.log
fi