HEX
Server: nginx/1.29.3
System: Linux 11979.bigscoots-wpo.com 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: nginx (1068)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_open,proc_close,popen,show_source,cmd# Do not modify this line # 1684243876
Upload Files
File: //bigscoots/includes/whosinmeh.sh
#!/bin/bash

# Check the initiating IP address first
[[ $- != *i* ]] || [[ $(echo $SSH_CLIENT | awk '{print $1}') == "67.202.70.147" ]] && exit 0

# Declare the associative array with IP-Name mapping
declare -A ip_name_map=(
  ["38.65.225.4"]="Justin"
  ["50.31.114.76"]="Jay"
  ["208.117.38.157"]="Shibin"
  ["208.117.38.23"]="Dean"
  ["198.175.25.80"]="Zach"
  ["208.117.38.24"]="Prasul"
  ["50.31.30.56"]="Zack"
  ["50.31.119.9"]="Julian"
  ["208.100.53.125"]="Sadiq"
  ["208.117.4.65"]="Michael"
  ["208.100.53.146"]="Khan"
  ["208.100.53.138"]="Gibu"
  ["74.121.204.16"]="JK"
  ["50.31.116.124"]="Minhal"
  ["69.162.134.133"]="Ahmad"
  ["50.31.99.57"]="Les"
  ["38.65.224.44"]="Lijith"
  ["23.29.145.178"]="Brian"
)

# Fetch currently logged-in IPs and their idle time
echo "Checking who is logged in..."

w -h | awk '{print $3,$5}' | while read -r ip idle_time; do
  ip=$(echo $ip | cut -d '.' -f 1-4)  # Strip port number if present
  tech_name=${ip_name_map[$ip]}
  if [ -n "$tech_name" ]; then
    echo "$tech_name is logged in from $ip and has been idle for $idle_time."
  else
    echo "Unknown person logged in from $ip and has been idle for $idle_time."
  fi
done

echo "You are now logged in."