Changeset 484 for scripts/usr/local/lib
- Timestamp:
- Nov 16, 2023, 2:47:20 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
scripts/usr/local/lib/7dtd/monitor-log.sh
r482 r484 92 92 local cmd="$1" 93 93 local name="$2" 94 95 echo "$(timestamp): Player \"$name\" executed \"$cmd\"" >> $COMMANDLOG 94 local clientInfo="$3" 95 96 echo "$(timestamp): Player \"$name\" executed \"$cmd\" (client $clientInfo)" >> $COMMANDLOG 96 97 97 98 for H in $(getHooksFor remoteCommand $INSTANCE); do 99 $H $INSTANCE "$cmd" "$name" 100 done 101 } 102 103 handleRemoteCommandDenied() { 104 local cmd="$1" 105 local name="$2" 106 local clientInfo="$3" 107 108 echo "$(timestamp): Denied \"$name\" to exec command \"$cmd\" (client $clientInfo)" >> $COMMANDLOG 109 110 for H in $(getHooksFor remoteCommandDenied $INSTANCE); do 98 111 $H $INSTANCE "$cmd" "$name" 99 112 done … … 180 193 #Executing command ".*" from client ".*"$ 181 194 elif [ -n "$(echo "$line" | grep '^Executing command '.*' from client')" ]; then 182 cmd=$(expr "$line" : "Executing command '\(.*\)' from client .*$") 183 nick=$(expr "$line" : "Executing command '.*' from client \(.*\)$") 184 handleRemoteCommand "$cmd" "$nick" 185 unset cmd nick 195 cmd=$(expr "$line" : "Executing command '\(.*\)' from client EntityID=.*, PltfmId='.*', CrossId='.*', OwnerID='.*', PlayerName='.*', ClientNumber='.*'$") 196 clientInfo=$(expr "$line" : "Executing command '.*' from client \(.*\)$") 197 playerName=$(expr "$line" : "Executing command '.*' from client EntityID=.*, PltfmId='.*', CrossId='.*', OwnerID='.*', PlayerName='\(.*\)', ClientNumber='.*'$") 198 handleRemoteCommand "$cmd" "$playerName" "$clientInfo" 199 unset cmd playerName clientInfo 200 #Denying command ".*" from client ".*"$ 201 elif [ -n "$(echo "$line" | grep '^Denying command '.*' from client')" ]; then 202 cmd=$(expr "$line" : "Denying command '\(.*\)' from client EntityID=.*, PltfmId='.*', CrossId='.*', OwnerID='.*', PlayerName='.*', ClientNumber='.*'$") 203 clientInfo=$(expr "$line" : "Denying command '.*' from client \(.*\)$") 204 playerName=$(expr "$line" : "Denying command '.*' from client EntityID=.*, PltfmId='.*', CrossId='.*', OwnerID='.*', PlayerName='\(.*\)', ClientNumber='.*'$") 205 handleRemoteCommandDenied "$cmd" "$playerName" "$clientInfo" 206 unset cmd playerName clientInfo 186 207 #Executing command ".*" by Telnet from .*$ 187 208 elif [ -n "$(echo "$line" | grep '^Executing command '.*' by Telnet from ')" ]; then
Note:
See TracChangeset
for help on using the changeset viewer.