diff options
author | Daniele Coli <danielsan.dani@gmail.com> | 2015-11-10 04:33:31 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-11-11 08:06:51 +0000 |
commit | 977130efca9cfa715c7bf8ee5c8d659be47b12d0 (patch) | |
tree | a96117d17917c54f1a963392cb26ddb736b0b63f | |
parent | adf805263f6649931d2fc123a0b327ff7331b75e (diff) | |
download | aports-977130efca9cfa715c7bf8ee5c8d659be47b12d0.tar.bz2 aports-977130efca9cfa715c7bf8ee5c8d659be47b12d0.tar.xz |
testing/cntlm: Added init.d script
Added init.d script compliant with rc-system. It supports multiple
instances of the service.
By default it looks for /etc/cntlm.conf file. You can define a new
service instance by creating a link to init.d script:
ln -s /etc/init.d/cntlm /etc/init.d/cntlm.<instance_name>
and by creating a new config file in /etc/cntlm.d/<instance_name>.conf
-rw-r--r-- | testing/cntlm/APKBUILD | 17 | ||||
-rw-r--r-- | testing/cntlm/cntlm.initd | 39 |
2 files changed, 52 insertions, 4 deletions
diff --git a/testing/cntlm/APKBUILD b/testing/cntlm/APKBUILD index 66b4596330..ca4609c9b2 100644 --- a/testing/cntlm/APKBUILD +++ b/testing/cntlm/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=cntlm pkgver=0.92.3 -pkgrel=0 +pkgrel=1 pkgdesc="NTLM Session Response / NTLMv2 authenticating HTTP proxy" url="http://cntlm.sourceforge.net/" arch="all" @@ -10,9 +10,11 @@ depends="" makedepends="" install="" subpackages="$pkgname-doc" -source="http://downloads.sourceforge.net/project/cntlm/cntlm/cntlm%20$pkgver/cntlm-$pkgver.tar.gz" - +source="http://downloads.sourceforge.net/project/cntlm/cntlm/cntlm%20$pkgver/cntlm-$pkgver.tar.gz + cntlm.initd + " _builddir="$srcdir"/cntlm-$pkgver + prepare() { local i cd "$_builddir" @@ -37,6 +39,13 @@ build() { package() { cd "$_builddir" make DESTDIR="$pkgdir" install || return 1 + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname } -md5sums="0d7fcfbfbef0546306b896be246caa88 cntlm-0.92.3.tar.gz" +md5sums="0d7fcfbfbef0546306b896be246caa88 cntlm-0.92.3.tar.gz +a8614b3bcd10b8f24429a6676b787360 cntlm.initd" +sha256sums="9c3ad10924d43f7248df9ecd33cbc033afbd7ea8d9545de0d68a2782fed76298 cntlm-0.92.3.tar.gz +8023516c6f5352ece48d6241d654c51bc94e873845978184036e27340674979e cntlm.initd" +sha512sums="64f97524f1c807dd3bad3f6c1cffb9d3315c720b086336b7379c8c6380c7c483a9c810b40e7e5ea463387476cd718a8e5fcbc1c7103d7128dfc72a8607e6fd39 cntlm-0.92.3.tar.gz +89982047495c9c62f14e2da5c076ca07942a62e9f87c0d455065c8f702412693ebdfd4e45eeb317a9a7285c4133080b0e7854607ea0daa99ff2420ec15216f97 cntlm.initd" diff --git a/testing/cntlm/cntlm.initd b/testing/cntlm/cntlm.initd new file mode 100644 index 0000000000..449d1f2361 --- /dev/null +++ b/testing/cntlm/cntlm.initd @@ -0,0 +1,39 @@ +#!/sbin/openrc-run + +description="Authenticating HTTP accelerator for NTLM secured proxies" + +depend() { + need localmount net + use dns logger + after bootmisc firewall +} + +checkconfig() { + CNTLM_INSTANCE=${SVCNAME#*.} + if [ -n "${CNTLM_INSTANCE}" -a "${SVCNAME}" != "cntlm" ]; then + CNTLM_CONF="/etc/cntlm.d/${CNTLM_INSTANCE}.conf" + CNTLM_PID="/var/run/cntlm.${CNTLM_INSTANCE}.pid" + else + CNTLM_CONF="/etc/cntlm.conf" + CNTLM_PID="/var/run/cntlm.pid" + fi + if [ ! -e ${CNTLM_CONF} ]; then + eerror "You will need an ${CNTLM_CONF} first" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/cntlm --pidfile "${CNTLM_PID}" \ + -- -c "${CNTLM_CONF}" -P "${CNTLM_PID}" + eend $? +} + +stop() { + checkconfig || return 1 + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --exec /usr/sbin/cntlm --pidfile "${CNTLM_PID}" + eend $? +} |