Subversion Repositories ALCASAR

Rev

Rev 2688 | Rev 2831 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2688 Rev 2825
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-dns-local.sh 2688 2019-01-18 23:15:49Z lucas.echard $
2
# $Id: alcasar-dns-local.sh 2825 2020-05-31 17:01:33Z rexy $
3
 
3
 
4
# alcasar-dns-local.sh
4
# alcasar-dns-local.sh
5
# by Rexy - 3abtux
5
# by Rexy - 3abtux
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
 
7
 
Line 65... Line 65...
65
			echo "$usage"
65
			echo "$usage"
66
			exit 1
66
			exit 1
67
		else
67
		else
68
			# removing if already exists
68
			# removing if already exists
69
			$SED "/^$2\t$3/d" $LOCAL_HOSTNAME_FILE
69
			$SED "/^$2\t$3/d" $LOCAL_HOSTNAME_FILE
70
 
-
 
71
			# adding to the hosts file
70
			# adding to the hosts file
72
			echo -e "$2\t$3" >> $LOCAL_HOSTNAME_FILE
71
			echo -e "$2\t$3" >> $LOCAL_HOSTNAME_FILE
73
			hosts_to_unbound
72
			hosts_to_unbound
74
			restart_dns
73
			restart_dns
75
		fi
74
		fi
Line 87... Line 86...
87
		;;
86
		;;
88
	--reload|-reload)
87
	--reload|-reload)
89
			hosts_to_unbound
88
			hosts_to_unbound
90
			restart_dns
89
			restart_dns
91
		;;
90
		;;
-
 
91
	--hosts_to_unbound|-hosts_to_unbound)
-
 
92
			hosts_to_unbound
-
 
93
		;;
92
	--off|-off) # disable DNS redirector
94
	--off|-off) # disable DNS redirector
93
		#$SED "s?^#filterwin2k.*?filterwin2k?g" $DNSMASQ_CONF_FILE
95
		#$SED "s?^#filterwin2k.*?filterwin2k?g" $DNSMASQ_CONF_FILE
94
		rm -f $LOCAL_DOMAIN_CONF_FILE
96
		rm -f $LOCAL_DOMAIN_CONF_FILE
95
		$SED "s?^INT_DNS_ACTIVE.*?INT_DNS_ACTIVE=off?g" $ALCASAR_CONF_FILE
97
		$SED "s?^INT_DNS_ACTIVE.*?INT_DNS_ACTIVE=off?g" $ALCASAR_CONF_FILE
96
		restart_dns
98
		restart_dns
Line 107... Line 109...
107
	name: "$INT_DNS_DOMAIN."
109
	name: "$INT_DNS_DOMAIN."
108
	forward-addr: $INT_DNS_IP
110
	forward-addr: $INT_DNS_IP
109
EOF
111
EOF
110
		$SED "s?^INT_DNS_ACTIVE.*?INT_DNS_ACTIVE=on?g" $ALCASAR_CONF_FILE
112
		$SED "s?^INT_DNS_ACTIVE.*?INT_DNS_ACTIVE=on?g" $ALCASAR_CONF_FILE
111
		restart_dns
113
		restart_dns
112
 
-
 
113
		# Reload firewall
114
		# Reload firewall
114
		/usr/local/bin/alcasar-iptables.sh
115
		/usr/local/bin/alcasar-iptables.sh
115
		;;
116
		;;
116
	*)
117
	*)
117
		echo "Argument inconnu : $1";
118
		echo "Argument inconnu : $1";