diff options
Diffstat (limited to 'deploy/pptpd/pptpd_install/auth-up')
| -rw-r--r-- | deploy/pptpd/pptpd_install/auth-up | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/deploy/pptpd/pptpd_install/auth-up b/deploy/pptpd/pptpd_install/auth-up new file mode 100644 index 0000000..d8a2c75 --- /dev/null +++ b/deploy/pptpd/pptpd_install/auth-up @@ -0,0 +1,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 + + + |
