summaryrefslogtreecommitdiff
path: root/system/c-icap/rc.c-icap
diff options
context:
space:
mode:
authorJeremy HOCDE <jeremyhocde@gmail.com>2017-07-20 20:07:11 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-07-22 06:56:17 +0700
commit43be981b640a597a525d85add4deb23f9c164a44 (patch)
tree4afc330a5204f0883b82e6c1512d004d7b893abb /system/c-icap/rc.c-icap
parentf52b58e1e972dd41dd8ba82096331b5b0a2a63d8 (diff)
downloadslackbuilds-43be981b640a597a525d85add4deb23f9c164a44.tar.gz
system/c-icap: Added (ICAP server).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'system/c-icap/rc.c-icap')
-rw-r--r--system/c-icap/rc.c-icap38
1 files changed, 38 insertions, 0 deletions
diff --git a/system/c-icap/rc.c-icap b/system/c-icap/rc.c-icap
new file mode 100644
index 0000000000..6dc06609ba
--- /dev/null
+++ b/system/c-icap/rc.c-icap
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Start/stop/restart c-icap.
+
+# Start c-icap:
+icap_start() {
+ CMDLINE="/usr/bin/c-icap"
+ echo -n "Starting c-icap daemon: $CMDLINE"
+ $CMDLINE -f /etc/c-icap.conf
+ echo
+}
+
+# Stop c-icap:
+icap_stop() {
+ echo -n "Stopping c-icap daemon..."
+ for i in $(pgrep -f c-icap); do kill -15 $i; done
+ echo
+}
+
+# Restart c-icap:
+icap_restart() {
+ icap_stop
+ sleep 1
+ icap_start
+}
+
+case "$1" in
+'start')
+ icap_start
+ ;;
+'stop')
+ icap_stop
+ ;;
+'restart')
+ icap_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac