summaryrefslogtreecommitdiffstats
path: root/openwrt/package/syslog-ng/files/syslog-ng.init
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/package/syslog-ng/files/syslog-ng.init')
-rwxr-xr-xopenwrt/package/syslog-ng/files/syslog-ng.init34
1 files changed, 34 insertions, 0 deletions
diff --git a/openwrt/package/syslog-ng/files/syslog-ng.init b/openwrt/package/syslog-ng/files/syslog-ng.init
new file mode 100755
index 000000000..40472ed3b
--- /dev/null
+++ b/openwrt/package/syslog-ng/files/syslog-ng.init
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+syslog_start() {
+ [ -f /etc/syslog-ng/syslog-ng.conf ] || {
+ echo "/etc/syslog-ng/syslog-ng.conf does not exist !";
+ exit 0;
+ };
+ [ -d /var/run ] || mkdir -p /var/run
+ [ -x /usr/sbin/syslog-ng ] && /usr/sbin/syslog-ng
+}
+
+syslog_stop() {
+ killall syslog-ng
+}
+
+case "$1" in
+ start)
+ syslog_start
+ ;;
+ stop)
+ syslog_stop
+ ;;
+ restart)
+ syslog_stop
+ sleep 1s
+ syslog_start
+ ;;
+ reload)
+ kill -HUP `cat /var/run/syslog-ng.pid` &>/dev/null
+ ;;
+ *)
+ echo "Usage: $0 <start|stop|restart|reload>"
+ ;;
+esac