diff options
Diffstat (limited to 'vpn/svpnsh')
-rwxr-xr-x | vpn/svpnsh | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ #! /bin/sh # svpnsh -- a simple vpn-only shell -# Copyright (C) 2007 Sergey Poznyakoff +# Copyright (C) 2007, 2009 Sergey Poznyakoff # # This program is free software; you can redistribute it and/or modify @@ -21,5 +21,5 @@ logmsg() { prio=$1 shift - /usr/bin/logger -t vpnsh -p auth.$prio $* + /usr/bin/logger -t svpnsh -p auth.$prio $* } @@ -31,7 +31,7 @@ if [ -z "$PAIR" ]; then 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 logmsg notice "$USER: too many concurrent logins" |