1
0
mirror of https://github.com/limosek/zaf-plugins.git synced 2024-11-01 08:17:19 +01:00
limosek-zaf-plugins/psx/proc-discovery.sh
2016-04-01 15:50:42 +02:00

17 lines
336 B
Bash
Executable File

#!/bin/sh
. ${ZAF_LIB_DIR}/zaf.lib.sh
. ${ZAF_LIB_DIR}/os.lib.sh
. ${ZAF_LIB_DIR}/ctrl.lib.sh
if [ "${ZAF_PKG}" = "opkg" ]; then
AWK='{ print $2" "$5; }'
PS="w"
else
AWK='{ print $1" "$11; }'
PS="--no-headers caux"
fi
ps $PS | awk "$AWK" | sort | uniq | sed -e 's/\//\\\//g' -e '$s/.$//' | zaf_discovery '{#PSNAME}' '{#PSUSER}'