#!/bin/sh case "$1" in start) echo -n "Zabbix_server - waiting for SQL server to start." while [ ! -e __PREFIX__/var/run/__VER__/mysqld.sock ]; do sleep 5; echo -n .; done echo " SQL server online; starting zabbix_server." sudo -u zabbix __PREFIX__/sbin/zabbix/zabbix_server -c __PREFIX__/etc/zabbix/zabbix_server.conf ;; stop) echo -n "Shutting down zabbix_server" pid=`ps axc|awk "{if (\\$5==\"zabbix_server\") print \\$1}"` /bin/kill $pid rm /tmp/zabbix_server.pid ;; restart) $0 stop $0 start ;; status) /bin/ps -ax |/usr/bin/grep zabbix_server ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac