#!/sbin/openrc-run # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 description="check running sunloginclinet loop" command="/opt/sunlogin/bin/oray_rundaemon" command_args="-e 'bash /opt/sunlogin/etc/watch.sh'" command_background=true pidfile="/run/${RC_SVCNAME}.pid" depend() { need net } stop_post() { psid=$(ps -ef | tr -s " " | cut -d " " -f 2,8 | grep sunloginclient | grep -v $0 | awk '{print $1}') if [ -n "$psid" ]; then killall sunloginclient fi eend $? }