Files
DirectAdmin-1.62.4/update/scripts/service_memory_usage.sh
tuend-work 4478491d73 z
2025-11-13 07:41:56 +07:00

18 lines
286 B
Bash

#!/bin/sh
PS=/bin/ps
AWK=/usr/bin/awk
GREP=/bin/grep
if [ ! -x $GREP ]; then
GREP=/usr/bin/grep
fi
SORT=/bin/sort
if [ ! -x $SORT ]; then
SORT=/usr/bin/sort
fi
$PS axo comm,rss | $AWK '{arr[$1]+=$2} END {for (i in arr) {print i "=" arr[i]/1024}}' | $GREP -v '=0$'
RET=$?
exit $RET