From 715631caf52784c47c8ed3aeb6cbdba2715a08db Mon Sep 17 00:00:00 2001 From: root Date: Sun, 26 Jun 2011 23:06:14 +0000 Subject: Sun Jun 26 23:06:14 UTC 2011 --- social/tinc/PKGBUILD | 17 +++++++++++++---- social/tinc/tincd.conf | 1 + social/tinc/tincd.rcd | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 social/tinc/tincd.conf create mode 100644 social/tinc/tincd.rcd (limited to 'social') diff --git a/social/tinc/PKGBUILD b/social/tinc/PKGBUILD index 1dd9ad328..a34d3785b 100644 --- a/social/tinc/PKGBUILD +++ b/social/tinc/PKGBUILD @@ -1,12 +1,15 @@ pkgname=tinc pkgver=1.0.15 -pkgrel=1 +pkgrel=2 pkgdesc="VPN (Virtual Private Network) daemon" arch=(i686 x86_64) url="http://www.tinc-vpn.org/" license=('GPL') depends=('lzo2' 'zlib' 'openssl') -source=(http://www.tinc-vpn.org/packages/tinc-$pkgver.tar.gz) +source=(http://www.tinc-vpn.org/packages/tinc-$pkgver.tar.gz + tincd.conf + tincd.rcd) +md5sums=('44bb7d1618955a0a56e9e159f1c46362') build() { cd "$srcdir/$pkgname-$pkgver" @@ -20,7 +23,13 @@ package() { make DESTDIR="$pkgdir" install - install -d $pkgdir/etc/tinc + install -d $pkgdir/etc/{tinc,rc.d,conf.d} + + install -Dm755 $srcdir/tincd.rcd $pkgdir/etc/rc.d/tincd + install -Dm755 $srcdir/tincd.conf $pkgdir/etc/conf.d/tincd + tar xzvf doc/sample-config.tar.gz -C $pkgdir/etc/tinc/ } -md5sums=('44bb7d1618955a0a56e9e159f1c46362') +md5sums=('44bb7d1618955a0a56e9e159f1c46362' + '9b40646cd898709e90ae3c32baecb075' + '75516d05803ee6c6b22516e10129ad99') diff --git a/social/tinc/tincd.conf b/social/tinc/tincd.conf new file mode 100644 index 000000000..84547936c --- /dev/null +++ b/social/tinc/tincd.conf @@ -0,0 +1 @@ +NETNAME=yournetname diff --git a/social/tinc/tincd.rcd b/social/tinc/tincd.rcd new file mode 100644 index 000000000..f0a456e17 --- /dev/null +++ b/social/tinc/tincd.rcd @@ -0,0 +1,43 @@ +#!/bin/bash + +daemon_name=tincd + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/$daemon_name.conf + +PID=`pidof -o %PPID /usr/sbin/tincd` + +case "$1" in + start) + stat_busy "Starting ${daemon_name}" + [ -z "$PID" ] && \ + /usr/sbin/tincd -n ${NETNAME} \ + --pidfile=/var/run/tinc.${NETNAME} &> /dev/null + + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon ${daemon_name} + stat_done + fi + ;; + stop) + stat_busy "Stopping ${daemon_name}" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon ${daemon_name} + stat_done + fi + ;; + restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 -- cgit v1.2.3-54-g00ecf