Subversion Repositories ALCASAR

Rev

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

Rev 2836 Rev 2838
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-dns-local.sh 2836 2020-06-15 22:03:08Z rexy $
2
# $Id: alcasar-dns-local.sh 2838 2020-06-21 22:15:26Z 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 84... Line 84...
84
		then
84
		then
85
			echo "$usage"
85
			echo "$usage"
86
			exit 1
86
			exit 1
87
		else
87
		else
88
			# removing if already exists
88
			# removing if already exists
89
			$SED "/^$2\t$3/d" $LOCAL_HOSTNAME_FILE
89
			$SED "/^$2[ \t]*$3/d" $LOCAL_HOSTNAME_FILE
90
			# adding to the hosts file
90
			# adding to the hosts file
91
			echo -e "$2\t$3" >> $LOCAL_HOSTNAME_FILE
91
			echo -e "$2\t$3" >> $LOCAL_HOSTNAME_FILE
92
			hosts_to_unbound
92
			hosts_to_unbound
93
			restart_dns
93
			restart_dns
94
		fi
94
		fi
Line 97... Line 97...
97
		if [ $nb_args -ne 3 ]
97
		if [ $nb_args -ne 3 ]
98
		then
98
		then
99
			echo "$usage"
99
			echo "$usage"
100
			exit 1
100
			exit 1
101
		else
101
		else
102
			$SED "/^$2\t$3/d" $LOCAL_HOSTNAME_FILE
102
			$SED "/^$2[ \t]*$3/d" $LOCAL_HOSTNAME_FILE
103
			hosts_to_unbound
103
			hosts_to_unbound
104
			restart_dns
104
			restart_dns
105
		fi
105
		fi
106
		;;
106
		;;
107
	--reload|-reload)
107
	--reload|-reload)