#!/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