* Matthias Buecher / Germany <[email protected]> [01.02.2010 18:20]: > > # check if client connection > - ps | grep -e "^[ ]*${pid} " | grep "${PROG}" >/dev/null > + ps | grep -e "^[ ]*${pid} " | grep -q -e "${PROG}" > if [ $? -eq 0 ] > then
I propose a more clever variant, which does not fork but
relies on procfs (but openWRT scripts rely on it anyway..)
fgrep -q "${PROG}" "/proc/${pid}/cmdline" 2>/dev/null && {
some_action
}
bye, Bastian
signature.asc
Description: Digital signature
_______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
