Changeset 298 for scripts/usr/local/lib


Ignore:
Timestamp:
Dec 8, 2016, 4:51:50 PM (8 years ago)
Author:
alloc
Message:

Fixed IP detection in log monitor script

Location:
scripts/usr/local/lib/7dtd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • scripts/usr/local/lib/7dtd/VERSION

    r296 r298  
    1 Version: 105
    2 Release: 2016-10-06
     1Version: 106
     2Release: 2016-12-08
    33
  • scripts/usr/local/lib/7dtd/monitor-log.sh

    r294 r298  
    123123        if [ -n "$line" ]; then
    124124                #Player connected, entityid=1278, name=termo2, steamid=76561197997439820, steamOwner=76561197997439820, ip=178.203.27.140
    125                 #Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=[0-9.]*$
     125                #Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=[a-fA-F:0-9.]*$
    126126                if [ -n "$(echo "$line" | grep '^Player connected,')" ]; then
    127                         entityId=$(expr "$line" : 'Player connected, entityid=\([0-9]*\), name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=[0-9.]*$')
    128                         playerName=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=\(.*\), steamid=[0-9]*, steamOwner=[0-9]*, ip=[0-9.]*$')
    129                         steamId=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=\([0-9]*\), steamOwner=[0-9]*, ip=[0-9.]*$')
    130                         steamOwner=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=\([0-9]*\), ip=[0-9.]*$')
    131                         ip=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=\([0-9.]*\)$')
     127                        entityId=$(expr "$line" : 'Player connected, entityid=\([0-9]*\), name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=[a-fA-F:0-9.]*$')
     128                        playerName=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=\(.*\), steamid=[0-9]*, steamOwner=[0-9]*, ip=[a-fA-F:0-9.]*$')
     129                        steamId=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=\([0-9]*\), steamOwner=[0-9]*, ip=[a-fA-F:0-9.]*$')
     130                        steamOwner=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=\([0-9]*\), ip=[a-fA-F:0-9.]*$')
     131                        ip=$(expr "$line" : 'Player connected, entityid=[0-9]*, name=.*, steamid=[0-9]*, steamOwner=[0-9]*, ip=\([a-fA-F:0-9.]*\)$')
    132132                        sleep 1
    133133                        handleConnect "$entityId" "$playerName" "$steamId" "$ip" "$steamOwner"
Note: See TracChangeset for help on using the changeset viewer.