diff options
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 47 | ||||
-rwxr-xr-x | coova-chilli | 136 |
3 files changed, 205 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..fb5c08cbcbdc --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = coova-chilli-arch + pkgdesc = an open-source software access controller + pkgver = 1.3.0 + pkgrel = 1 + url = http://coova.org/CoovaChilli + arch = i686 + arch = x86_64 + license = GPL + depends = curl + depends = libpcap + depends = openssl + optdepends = python2 + replaces = coova-chilli + options = !libtool + backup = etc/chilli.conf + source = http://ap.coova.org/chilli/coova-chilli-1.3.0.tar.gz + source = coova-chilli + md5sums = dc0037e3cdebcb60508081b4e42e984a + md5sums = b416def2a56b69f0e5c3b5b09703cda9 + +pkgname = coova-chilli-arch + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..bda256ac39e5 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: M0Rf30 + +pkgname=coova-chilli-arch +pkgver=1.3.0 +pkgrel=1 +pkgdesc='an open-source software access controller' +arch=('i686' 'x86_64') +url="http://coova.org/CoovaChilli" +license=('GPL') +depends=('curl' 'libpcap' 'openssl') +optdepends=('python2') +options=(!libtool) +replaces=(coova-chilli) +source=(http://ap.coova.org/chilli/coova-chilli-${pkgver}.tar.gz +coova-chilli) +backup=('etc/chilli.conf') + +build() { + cd "${srcdir}/coova-chilli-${pkgver}" + + export CFLAGS="-Wno-error=unused-but-set-variable" + + ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \ + --enable-statusfile \ + --disable-static \ + --enable-shared \ + --enable-largelimits \ + --enable-miniportal \ + --enable-chilliredir \ + --enable-chilliproxy \ + --enable-chilliscript \ + --with-poll \ + --with-openssl \ + --enable-chilliradsec + make +} + +package() { + cd "${srcdir}/coova-chilli-${pkgver}" + make DESTDIR="${pkgdir}" install + rm -rf ${pkgdir}/etc/init.d + install -D $srcdir/coova-chilli $pkgdir/etc/rc.d/coova-chilli + chmod +x $pkgdir/etc/rc.d/coova-chilli +} + +md5sums=('dc0037e3cdebcb60508081b4e42e984a' + 'b416def2a56b69f0e5c3b5b09703cda9') diff --git a/coova-chilli b/coova-chilli new file mode 100755 index 000000000000..dccfc06afb60 --- /dev/null +++ b/coova-chilli @@ -0,0 +1,136 @@ +#!/bin/bash + +daemon_name=coova-chilli + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/chilli/functions + +DAEMON=/usr/sbin/chilli +NAME=chilli +DESC=chilli +START_CHILLI=1 + +if [ "$START_CHILLI" != "1" ] ; then + echo "Chilli default off. Look at /etc/default/chilli" + exit 0 +fi + +test -f $DAEMON || exit 0 + +MULTI=$(ls /etc/chilli/*/chilli.conf 2>/dev/null) +[ -z "$DHCPIF" ] && [ -n "$MULTI" ] && { + for c in $MULTI; + do + echo "Found configuration $c" + DHCPIF=$(basename $(echo $c|sed 's#/chilli.conf##')) + export DHCPIF + echo "Running DHCPIF=$DHCPIF $0 $*" + sh $0 $* + done + exit +} + +if [ -n "$DHCPIF" ]; then + CONFIG=/etc/chilli/$DHCPIF/chilli.conf +else + CONFIG=/etc/chilli.conf +fi + +[ -f $CONFIG ] || { + echo "$CONFIG Not found" + exit 0 +} + + +case "$1" in + start) + stat_busy "Starting Coovachilli" + /sbin/modprobe tun >/dev/null 2>&1 + echo 1 > /proc/sys/net/ipv4/ip_forward + + writeconfig + radiusconfig + + test ${HS_ADMINTERVAL:-0} -gt 0 && { + (crontab -l 2>&- | grep -v $0 + echo "*/$HS_ADMINTERVAL * * * * $0 radconfig" + ) | crontab - 2>&- + } + + ifconfig $HS_LANIF 0.0.0.0 + + [ ! -d /var/run/coovachilli ] && install -d /var/run/coovachilli + if $DAEMON start >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + stop) + stat_busy "Stopping Coovachilli" + crontab -l 2>&- | grep -v $0 | crontab - + if $DAEMON stop >/dev/null ; then + rm_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + + + restart) + stat_busy "Restarting Coovachilli" + if $DAEMON restart >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + condrestart) + stat_busy "Restarting Coovachilli" + if DAEMON restart >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + status) + stat_busy "Checking Coovachilli status"; + ck_status $daemon_name + ;; + + reload) + stat_busy "Reloading Coovachilli" + if $DAEMON graceful >/dev/null ; then + add_daemon $daemon_name + stat_done + else + stat_fail + exit 1 + fi + ;; + + radconfig) + [ -e $MAIN_CONF ] || writeconfig + radiusconfig + ;; + + + + *) + echo "usage: $0 {start|stop|restart|condrestart|status|reload|radconfig}" +esac + +exit 0 |