wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py

arekm cvs at pld-linux.org
Thu May 25 12:20:47 CEST 2006


Author: arekm
Date: Thu May 25 12:20:41 2006
New Revision: 7442

Modified:
   wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py
Log:
Fixes.

Modified: wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py
==============================================================================
--- wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py	(original)
+++ wireless-net/trunk/sysconfig/interfaces/up.d/ppp/wlan-up.py	Thu May 25 12:20:41 2006
@@ -59,14 +59,14 @@
     pd = os.popen("/sbin/ip addr show 2>&1 | /bin/grep -E \'peer %s/[[:digit:]]+.*ppp[[:digit:]]+\' | /bin/sed -e \'s#.* global ##g\'" % ppp_remip, "r")
     used_ifaces = pd.readlines()
     pd.close()
+    used_ifaces = [i.strip() for i in used_ifaces]
     for iface in used_ifaces:
         if iface == ppp_iface:
             used_ifaces.remove(iface)
     # already logged - kill old sessions
-    if len(used_ifaces) > 1:
-        fl.write("%s: \"%s\" already logged in - killing stale sessions [iface=%s, ip=%s, mac=%s]\n" % (time.asctime(time.gmtime()), user, ppp_iface, ip, reth_mac))
+    if len(used_ifaces):
+        fl.write("%s: \"%s\" already logged in - killing stale sessions [stale=%s, iface=%s, ip=%s, mac=%s]\n" % (time.asctime(time.gmtime()), user, used_ifaces, ppp_iface, ip, reth_mac))
     for iface in used_ifaces:
-        iface = string.strip(iface)
         os.system("/bin/kill -TERM `/bin/cat /var/run/%s.pid` > /dev/null 2>&1" % iface)
     fl.write("%s: \"%s\" logged in [iface=%s, ip=%s, mac=%s]\n"
             % (time.asctime(time.gmtime()), user, ppp_iface, ip, reth_mac))


More information about the pld-cvs-commit mailing list