pkgsrc/net/cntlm/files/cntlm.sh
jym caccbd0e2c Initial import of cntlm 0.35.1 into the NetBSD package system.
Cntlm is an NTLM/NTLMv2 authenticating HTTP proxy. It takes the address of your
proxy or proxies (host1..N and port1..N) and opens a listening socket,
forwarding each request to the parent proxy (moving in a circular list if the
active parent stops working). Along the way, a connection to the parent is
created anew and authenticated or, if available, previously cached connection
is reused to achieve higher efficiency and faster responses. When the chain is
set up, cntlm should be used as a proxy in your applications. Cntlm also
integrates transparent TCP/IP port forwarding (tunneling) through the parent
(incl. authentication).

It can be used against most ISA servers, and helps to provide ease of
integration for programs not supporting NTLM authentication directly, via
cntlm's builtin SOCKS5 proxy.
2009-10-30 19:55:30 +00:00

54 lines
1 KiB
Bash

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: cntlm.sh,v 1.1.1.1 2009/10/30 19:55:30 jym Exp $
#
# PROVIDE: cntlm
# REQUIRE: DAEMON
#
# You will need to set some variables in /etc/rc.conf to start cntlm:
#
# cntlm=YES
#
# The following variables are optional:
#
# cntlm_flags="" # Additional flags to pass to cntlm
#
# "cntlm_flags" contains options for the cntlm daemon. See cntlm(1) for
# possible options.
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
name="cntlm"
rcvar=${name}
cntlm_config="@PKG_SYSCONFDIR@/${name}.conf"
cntlm_user="@CNTLM_USER@"
pidfile="@VARBASE@/run/${name}.pid"
command="@PREFIX@/bin/${name}"
command_args="-U $cntlm_user -P $pidfile -c $cntlm_config "
required_files="$cntlm_config"
start_precmd="cntlm_prestartcmd"
stop_postcmd="cntlm_poststopcmd"
cntlm_prestartcmd() {
touch $pidfile
chown $cntlm_user $pidfile
}
cntlm_poststopcmd() {
if [ -f $pidfile ]; then
rm -f $pidfile
fi
}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n ' ${name}'
${command} ${cntlm_flags} ${command_args}
fi