#!/bin/bash
set -e
sed -e '/^#/d' -e '/^$/d'  /etc/dnsmasq.conf | grep . && mv /etc/dnsmasq.conf /etc/dnsmasq.conf.dpkg-old
[ "$(readlink /etc/nftables.conf)" = /etc/omix/gw/conf/nftables.conf ] || \
mv /etc/nftables.conf /etc/nftables.conf.dpkg-old
/usr/share/omix/mkconf
sed -i -e 's?^CONFIG_DIR=.*$?CONFIG_DIR=/etc/dnsmasq.d,\*.conf?' /etc/default/dnsmasq
systemctl restart dnsmasq
[ -L /etc/nftables.conf ] || ln -s /etc/omix/gw/conf/nftables.conf /etc/nftables.conf 
#systemctl restart nftables

