882,6 → 882,12 |
{ |
# chilli unit for systemd |
cat << EOF > /lib/systemd/system/chilli.service |
# This file is part of systemd. |
# |
# systemd is free software; you can redistribute it and/or modify it |
# under the terms of the GNU General Public License as published by |
# the Free Software Foundation; either version 2 of the License, or |
# (at your option) any later version. |
[Unit] |
Description=chilli is a captive portal daemon |
After=network.target |
1184,7 → 1190,6 |
cp -f $DIR_CONF/nfsen/PortTracker.pm /tmp/nfsen-1.3.6p1/contrib/PortTracker/ |
# use of our conf file and init unit |
cp $DIR_CONF/nfsen/nfsen.conf /tmp/nfsen-1.3.6p1/etc/ |
cp $DIR_CONF/nfsen/nfsen.service /lib/systemd/system/ |
# Installation of nfsen |
DirTmp=$(pwd) |
cd /tmp/nfsen-1.3.6p1/ |
1211,6 → 1216,31 |
php_flag track_vars on |
</Directory> |
EOF |
# nfsen unit for systemd |
cat << EOF > /lib/systemd/system/nfsen.service |
# This file is part of systemd. |
# |
# systemd is free software; you can redistribute it and/or modify it |
# under the terms of the GNU General Public License as published by |
# the Free Software Foundation; either version 2 of the License, or |
# (at your option) any later version. |
|
# This unit launches nfsen (a Netflow grapher). |
[Unit] |
Description= NfSen init script |
After=network.target iptables.service |
|
[Service] |
Type=oneshot |
RemainAfterExit=yes |
ExecStart=/usr/bin/nfsen start |
ExecStop=/usr/bin/nfsen stop |
ExecRestart=/usr/bin/nfsen restart |
TimeoutSec=0 |
|
[Install] |
WantedBy=multi-user.target |
EOF |
# Add the listen port to collect netflow packet (nfcapd) |
$SED s?'\$ziparg $extensions.*?\$ziparg $extensions -b 127.0.0.1";'?g /usr/libexec/NfSenRC.pm |
# expire delay for the profile "live" |
1296,13 → 1326,13 |
filterwin2k |
address=/#/$PRIVATE_IP |
EOF |
# Start after chilli (which create tun0) |
$SED "s?^After=.*?After=syslog.target network.target chilli.service?g" /lib/systemd/system/dnsmasq.service |
# Create dnsmasq-blacklist and dnsmasq-whitelist unit |
cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-blacklist.service |
cp -f /lib/systemd/system/dnsmasq.service /lib/systemd/system/dnsmasq-whitelist.service |
$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/dnsmasq -C /etc/dnsmasq-blacklist.conf?g" /lib/systemd/system/dnsmasq-blacklist.service |
$SED "s?^ExecStart=.*?ExecStart=/usr/sbin/dnsmasq -C /etc/dnsmasq-whitelist.conf?g" /lib/systemd/system/dnsmasq-whitelist.service |
# TODO Start after chilli which create tun0 |
# $SED "s?^# chkconfig:.*?# chkconfig: 2345 99 40?g" /etc/init.d/dnsmasq |
} # End dnsmasq |
|
########################################################## |