diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | vpn/svpnsh | 10 |
2 files changed, 9 insertions, 5 deletions
@@ -1 +1,5 @@ +2009-08-03 Sergey Poznyakoff <gray@gnu.org.ua> + + * vpn/svpnsh: Fix concurrent login recognition. + 2009-03-19 Sergey Poznyakoff <gray@gnu.org.ua> @@ -2,3 +2,3 @@ # svpnsh -- a simple vpn-only shell -# Copyright (C) 2007 Sergey Poznyakoff +# Copyright (C) 2007, 2009 Sergey Poznyakoff # @@ -22,3 +22,3 @@ logmsg() { shift - /usr/bin/logger -t vpnsh -p auth.$prio $* + /usr/bin/logger -t svpnsh -p auth.$prio $* } @@ -32,5 +32,5 @@ fi -NLOGINS=`who -q | sed '2,$d' | tr ' ' '\n' | sort | sed '1d' | uniq -c | - awk "\\$2==\"$USER\" { print \\$1 }"` -if [ ${NLOGINS:-0} -gt 1 ] +sdup=`who -q | sed '/^#/d' | tr -s ' ' '\n' | sort | uniq -d | grep "$USER"` + +if [ -n "$sdup" ] then |