packages/monit: use new service functions, fix /etc/monitrc permissions
[openwrt/svn-archive/archive.git] / admin / monit / files / monit.init
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
3
4 START=60
5
6 SERVICE_USE_PID=1
7
8 start() {
9 [ -f /etc/monitrc ] || return 1
10 [ "$(stat -c "%a" /etc/monitrc)" = "0700" ] || chmod 0700 /etc/monitrc
11 service_start /usr/bin/monit -d 60
12 }
13
14 stop() {
15 service_stop /usr/bin/monit
16 }