#!/bin/bash
Ip_addr=`cat /etc/dnsrecord.txt  |awk '{print $1}' |head -1`
Check_dns_url(){
  grep $1  /etc/dnsrecord.txt >/dev/null
  if [ $? -ne 0 ];then
    echo "${Ip_addr} $1 " >> /etc/dnsrecord.txt
    echo "添加 ${1}到 dns 配置中"
  else
    echo "${1} 配置已经存在,不用重复添加。"
  fi
}
Check_dns_url cr-ticket.okjiaoyu.cn
Check_dns_url cr-spear.okjiaoyu.cn
kill -9 `ps -ef |grep dnsmasq |grep -v "grep --color=auto dns" |awk '{print $2}'` >/dev/null 2>&1
/etc/init.d/dnsmasq  start >>/dev/null

  

相关文章:

  • 2022-01-03
  • 2022-12-23
  • 2021-08-06
  • 2021-06-20
  • 2022-01-09
  • 2022-02-21
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2021-11-16
  • 2021-06-04
  • 2021-11-13
相关资源
相似解决方案