151,11 → 151,11 |
NAME FR: ossi-wl |
NAME EN: ossi-wl |
|
NAME: ossi-tor_nodes |
NAME: ossi-bl-tor_nodes |
DEFAULT_TYPE: black |
SOURCE: ALCASAR Team |
DESC FR: Adresses IP des noeuds (routeurs) d'entrée du réseau TOR |
DESC EN:IP addresses of input TOR nodes (routers) |
DESC EN: IP addresses of input TOR nodes (routers) |
NAME FR: Noeuds TOR |
NAME EN: TOR nodes |
EOF |
176,7 → 176,7 |
for dir_categorie in `cat $FILE_tmp` # create the blacklist and the whitelist files |
do |
categorie=`echo $dir_categorie|cut -d "/" -f6` |
categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$categorie $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"` |
categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$categorie$ $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"` |
if [ "$categorie_type" == "white" ] |
then |
echo "$dir_categorie" >> $WL_CATEGORIES |
309,7 → 309,7 |
for ossi_custom_dir in `cat $FILE_tmp` # create the blacklist and the whitelist files |
do |
ossi_categorie=`echo $ossi_custom_dir|cut -d "/" -f6` |
categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$ossi_categorie $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"` |
categorie_type=`grep -A1 ^NAME:[$' '$'\t']*$ossi_categorie$ $DIR_DG_BL/global_usage | grep ^DEFAULT_TYPE | cut -d":" -f2 | tr -d " \t"` |
$SED "s/\.\{2,10\}/\./g" $ossi_custom_dir/domains $ossi_custom_dir/urls # correction 'coma" instead of 'dot' |
$SED "/^$/d" $ossi_custom_dir/domains $ossi_custom_dir/urls # remove empty lines |
# extract ip addresses for iptables |
318,25 → 318,42 |
egrep -v "^([0-9]{1,3}\.){3}[0-9]{1,3}$" $ossi_custom_dir/domains > $FILE_tmp |
$SED "/[äâëêïîöôüû]/d" $FILE_tmp |
$SED "/^#.*/d" $FILE_tmp |
if [ "$categorie_type" == "white" ] |
if [ $categorie_type == "white" ] |
then |
# adapt to the dnsmasq syntax for the whitelist |
echo "$ossi_categorie : WL" |
# adapt the file to the dnsmasq syntax and enable it if needed |
# for the WL |
$SED "s?.*?server=/&/$DNS1?g" $FILE_tmp |
mv $FILE_tmp $DIR_DNS_WL/$ossi_categorie.conf |
ln -sf $DIR_DNS_WL/$ossi_categorie.conf $DIR_DNS_WL_ENABLED/$ossi_categorie |
mv $FILE_ip_tmp $DIR_IP_WL/$ossi_categorie |
ln -sf $DIR_IP_WL/$ossi_categorie $DIR_IP_WL_ENABLED/$ossi_categorie |
enabled=`grep ^$ossi_categorie$ $WL_CATEGORIES_ENABLED | wc -l` |
if [ $enabled == "1" ] |
then |
echo "wl - $ossi_categorie - $categorie_type" |
$SED "/\/$ossi_categorie$/d" $WL_CATEGORIES |
$SED "1i\/etc\/dansguardian\/lists\/blacklists\/$ossi_categorie" $WL_CATEGORIES |
ln -sf $DIR_DNS_WL/$ossi_categorie.conf $DIR_DNS_WL_ENABLED/$ossi_categorie |
ln -sf $DIR_IP_WL/$ossi_categorie $DIR_IP_WL_ENABLED/$ossi_categorie |
fi |
else |
# adapt to the dnsmasq syntax for the blacklist |
echo "$ossi_categorie : BL" |
# for the BL |
$SED "s?.*?address=/&/$PRIVATE_IP?g" $FILE_tmp |
mv $FILE_tmp $DIR_DNS_BL/$ossi_categorie.conf |
ln -sf $DIR_DNS_BL/$ossi_categorie.conf $DIR_DNS_BL_ENABLED/$ossi_categorie |
mv $FILE_ip_tmp $DIR_IP_BL/$ossi_categorie |
ln -sf $DIR_IP_BL/$ossi_categorie $DIR_IP_BL_ENABLED/$ossi_categorie |
enabled=`grep ^$ossi_categorie$ $BL_CATEGORIES_ENABLED | wc -l` |
if [ $enabled == "1" ] |
then |
echo "bl - $ossi_categorie - $categorie_type" |
$SED "/\/$ossi_categorie$/d" $BL_CATEGORIES |
$SED "1i\/etc\/dansguardian\/lists\/blacklists\/$ossi_categorie" $BL_CATEGORIES |
ln -sf $DIR_DNS_BL/$ossi_categorie.conf $DIR_DNS_BL_ENABLED/$ossi_categorie |
ln -sf $DIR_IP_BL/$ossi_categorie $DIR_IP_BL_ENABLED/$ossi_categorie |
fi |
fi |
done |
sort +0.0 -0.2 $BL_CATEGORIES -o $FILE_tmp |
mv $FILE_tmp $BL_CATEGORIES |
sort +0.0 -0.2 $WL_CATEGORIES -o $FILE_tmp |
mv $FILE_tmp $WL_CATEGORIES |
/usr/bin/systemctl restart dnsmasq-blacklist |
/usr/bin/systemctl restart dnsmasq-whitelist |
/usr/local/bin/alcasar-iptables.sh |