#!/bin/bash
# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES
#
# It is highly advisable to create own systemd services or udev rules
# to run scripts during boot instead of using this file.
#
# In contrast to previous versions due to parallel execution during boot
# this script will NOT be run after all other services.
#
# Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure
# that this script will be executed during boot.

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

#add another local ip
#/sbin/ifconfig eth0:0 192.168.1.3 netmask 255.255.255.0

# Added by hwdsl2 VPN script
#iptables-restore < /etc/sysconfig/iptables

#service fail2ban restart
#service ipsec start
#service xl2tpd start
echo 1 > /proc/sys/net/ipv4/ip_forward

# clamav
mkdir -p /var/run/clamav
chown amavis:amavis /var/run/clamav
systemctl restart clamd

# ip gre tunnel to edgemax
#ip tunnel add tun0 mode gre remote 86.104.210.218 local 192.168.1.2 ttl 255
#ip link set tun0 up
sleep 1
#ip addr add 10.209.0.2/30 dev tun0
#ip r a 10.208.1.0/24 dev tun0
#ip r a 10.108.254.0/24 dev tun0
#ip r a 10.208.99.0/24 dev tun0
#ip r a 172.16.100.0/24 dev tun0
#ip r a 10.208.0.0/30 dev tun0

# ip gre tunnel to er4
#ip tunnel add tun1 mode gre remote 5.2.152.69 local 192.168.1.2 ttl 255
#ip link set tun1 up
#sleep 1
#ip addr add 10.109.0.2/30 dev tun1
#ip r a 10.108.1.0/24 dev tun1
#ip r a 10.108.254.0/24 dev tun1
#ip r a 10.108.99.0/24 dev tun1
#ip r a 10.108.0.0/30 dev tun1

# enable darkstat
#sleep 90
/usr/local/sbin/darkstat -i eth0 -p 9999 --no-dns

# named.stats
#sleep 150
chown named:named /var/named/named.stats

#
#echo none > /sys/block/vda/queue/scheduler

