summaryrefslogtreecommitdiffstats
path: root/system/cntlm/rc.cntlm
diff options
context:
space:
mode:
author Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com>2015-04-10 17:29:00 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2015-04-10 17:29:00 +0700
commit8ed78fdce56ddeae8713c27054aa264086c63316 (patch)
tree37ef666026ea3756f64e9d698d8f68b00a29d65f /system/cntlm/rc.cntlm
parent09af7691b2cb195d52deb067e720e782cbbdc21d (diff)
downloadslackbuilds-8ed78fdce56ddeae8713c27054aa264086c63316.tar.gz
slackbuilds-8ed78fdce56ddeae8713c27054aa264086c63316.tar.xz
system/cntlm: Added (Authentication Proxy).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/cntlm/rc.cntlm')
-rw-r--r--system/cntlm/rc.cntlm64
1 files changed, 64 insertions, 0 deletions
diff --git a/system/cntlm/rc.cntlm b/system/cntlm/rc.cntlm
new file mode 100644
index 0000000000..7aee0f70b5
--- /dev/null
+++ b/system/cntlm/rc.cntlm
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# cntlm - NTLM Authentication Proxy
+
+
+exec="/usr/sbin/cntlm"
+prog=cntlm
+pidfile="/var/run/cntlm.pid"
+
+start() {
+ echo -n $"Starting $prog... "
+ if [ -e $pidfile ];then
+ if ps `cat $pidfile`|grep -q $exec >/dev/null 2>&1 ; then
+ echo "already running!"
+ return 1
+ else
+ rm $pidfile
+ fi
+ fi
+ $exec -f -c /etc/cntlm.conf -P $pidfile > /dev/null 2>&1 & pid=$!
+ retval=$?
+ if [ $retval -eq 0 ];then
+ echo "done."
+ echo $pid > $pidfile
+ fi
+ return $retval
+}
+
+stop() {
+ echo -n $"Stopping $prog... "
+ if [ ! -e $pidfile ];then
+ ps -ef|grep -v grep|grep -q $exec && ( killall -9 $prog ; echo "done." ) || echo "already stopped!"
+ return 0
+ fi
+ kill -9 `cat $pidfile` >/dev/null 2>&1
+ if ps `cat $pidfile`|grep -q $exec >/dev/null 2>&1 ; then
+ echo "fail!"
+ return 1
+ else
+ rm $pidfile
+ echo "done."
+ return 0
+ fi
+}
+
+restart() {
+ stop
+ start
+}
+
+
+case "$1" in
+ start)
+ $1
+ ;;
+ stop)
+ $1
+ ;;
+ restart)
+ $1
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|restart}";;
+esac \ No newline at end of file