123456789101112131415161718192021222324252627282930313233343536373839 |
- #!/sbin/openrc-run
- name="nginx-ui"
- description="Nginx UI - Yet another WebUI for Nginx"
- supervisor=supervise-daemon
- command="/usr/local/bin/nginx-ui"
- command_args="-config /usr/local/etc/nginx-ui/app.ini"
- pidfile="/run/${RC_SVCNAME}.pid"
- command_user="root:root"
- extra_commands="status"
- depend() {
- need net
- after logger firewall
- use dns
- after nginx
- }
- start_pre() {
- checkpath --directory --owner $command_user --mode 0755 /run
- checkpath --directory --owner $command_user --mode 0755 /usr/local/etc/nginx-ui
- }
- status() {
- if [ -f "${pidfile}" ]; then
- PID=$(cat "${pidfile}")
- if kill -0 $PID >/dev/null 2>&1; then
- einfo "${name} is running (PID: $PID)"
- return 0
- else
- ewarn "${name} is not running (stale PID file)"
- return 1
- fi
- else
- einfo "${name} is not running"
- return 3
- fi
- }
|