-rwxr-xr-x | root/usr/bin/changedns | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/root/usr/bin/changedns b/root/usr/bin/changedns index 8270e86..5059d08 100755 --- a/root/usr/bin/changedns +++ b/root/usr/bin/changedns | |||
@@ -12,13 +12,13 @@ usage ( ) { | |||
12 | 12 | ||
13 | 13 | ||
14 | [ "$#" -le 1 ] && usage | 14 | [ "$#" -le 1 ] && usage |
15 | 15 | ||
16 | shift | 16 | shift |
17 | 17 | ||
18 | cp /etc/resolv.conf $tmpfile | 18 | [ -f /etc/resolv.conf ] && cp /etc/resolv.conf $tmpfile |
19 | 19 | ||
20 | case "$arg1" in | 20 | case "$arg1" in |
21 | "-a") | 21 | "-a") |
22 | for ip in "$@"; do | 22 | for ip in "$@"; do |
23 | echo $ip | 23 | echo $ip |
24 | grep -sq "^nameserver $ip\$" $tmpfile || echo "nameserver $ip" >>$tmpfile | 24 | grep -sq "^nameserver $ip\$" $tmpfile || echo "nameserver $ip" >>$tmpfile |