mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
7b251fe9df
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
29 lines
615 B
Bash
29 lines
615 B
Bash
#!/bin/sh
|
|
|
|
users_agent_start() {
|
|
if [ ! -e /var/run/users-agent/jud.pid ]; then
|
|
su - %JUDUSR% -c "/usr/bin/users-agent -c /etc/users-agent/config.xml &"
|
|
su - %JUDUSR% -c "ps ux" | awk '/users-agent/ && !/awk/ {print $2}' > /var/run/users-agent/jud.pid
|
|
fi
|
|
}
|
|
|
|
users_agent_stop() {
|
|
kill `cat /var/run/users-agent/jud.pid 2> /dev/null` 2> /dev/null
|
|
rm -rf /var/run/users-agent/jud.pid 2> /dev/null
|
|
}
|
|
|
|
case $1 in
|
|
'start')
|
|
users_agent_start
|
|
;;
|
|
'stop')
|
|
users_agent_stop
|
|
;;
|
|
'restart')
|
|
users_agent_stop
|
|
sleep 2
|
|
users_agent_start
|
|
;;
|
|
*)
|
|
echo "usage: `basename $0` {start|stop|restart}"
|
|
esac
|