diff options
author | M0Rf30 | 2016-11-07 18:11:07 +0100 |
---|---|---|
committer | M0Rf30 | 2016-11-07 18:11:07 +0100 |
commit | a2eb7a08cbfafe48203cbd2fb3581584d4aa3b29 (patch) | |
tree | 63c4a730fd0ceda4ec0ba883b854973b16d0953a | |
parent | ea3297fcecde8d2c0edf5680582d6fa8650a609d (diff) | |
download | aur-a2eb7a08cbfafe48203cbd2fb3581584d4aa3b29.tar.gz |
systemd unit
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | chilli.install | 5 | ||||
-rwxr-xr-x | chilli.service | 144 |
4 files changed, 31 insertions, 141 deletions
@@ -1,10 +1,11 @@ # Generated by mksrcinfo v8 -# Mon Nov 7 16:31:22 UTC 2016 +# Mon Nov 7 17:10:47 UTC 2016 pkgbase = coova-chilli-arch pkgdesc = an open-source software access controller pkgver = 1.3.2 pkgrel = 1 url = https://coova.github.io/ + install = chilli.install arch = i686 arch = x86_64 license = GPL @@ -19,7 +20,7 @@ pkgbase = coova-chilli-arch source = https://github.com/coova/coova-chilli/archive/1.3.2.tar.gz source = chilli.service md5sums = 26e02689f632ad27ad599bc0d9f5ae3d - md5sums = b416def2a56b69f0e5c3b5b09703cda9 + md5sums = 828147e21eac257c3b700ea7f4ca3d98 pkgname = coova-chilli-arch @@ -13,8 +13,9 @@ optdepends=('python2') options=(!libtool) replaces=(coova-chilli) source=("https://github.com/coova/coova-chilli/archive/$pkgver.tar.gz" - chilli.service) + chilli.service) backup=('etc/chilli.conf') +install=chilli.install build() { cd "${srcdir}/coova-chilli-${pkgver}" @@ -22,14 +23,14 @@ build() { ./bootstrap ./configure --prefix=/usr --sbindir=/usr/bin/ \ --sysconfdir=/etc --localstatedir=/var \ - --enable-statusfile \ - --disable-static \ - --enable-shared \ + --enable-statusfile \ + --disable-static \ + --enable-shared \ --enable-largelimits \ --enable-miniportal \ --enable-chilliredir \ --enable-chilliproxy \ - --enable-chilliscript \ + --enable-chilliscript \ --with-poll \ --with-openssl \ --enable-chilliradsec @@ -39,7 +40,12 @@ build() { package() { cd "${srcdir}/coova-chilli-${pkgver}" make DESTDIR="${pkgdir}" install + +msg2 "Installing systemd unit for ${pkgname}" + install -Dm0644 ../chilli.service $pkgdir/usr/lib/systemd/system/chilli.service } md5sums=('26e02689f632ad27ad599bc0d9f5ae3d' - 'b416def2a56b69f0e5c3b5b09703cda9') + '828147e21eac257c3b700ea7f4ca3d98') +md5sums=('26e02689f632ad27ad599bc0d9f5ae3d' + '828147e21eac257c3b700ea7f4ca3d98') diff --git a/chilli.install b/chilli.install new file mode 100644 index 000000000000..8e550c503d85 --- /dev/null +++ b/chilli.install @@ -0,0 +1,5 @@ +post_install() { + echo -n ">>> Please, configure your captive portal" + echo -n ">>>>> Conf Path: /etc/chilli" +} + diff --git a/chilli.service b/chilli.service index dccfc06afb60..0893c4c9dfa1 100755 --- a/chilli.service +++ b/chilli.service @@ -1,136 +1,14 @@ -#!/bin/bash +[Unit] +Description=CoovaChilli captive portal +After=network.target -daemon_name=coova-chilli +[Service] +Type=forking +User=root +ExecStartPre=/usr/bin/modprobe tun +ExecStartPre=/usr/bin/echo 1 > /proc/sys/net/ipv4/ip_forward +ExecStart=/usr/bin/chilli -. /etc/rc.conf -. /etc/rc.d/functions -. /etc/chilli/functions +[Install] +WantedBy=multi-user.target -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 |