29 lines
522 B
Bash
Executable file
29 lines
522 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
OS=$(uname -s)
|
|
REL=$(uname -r)
|
|
|
|
function sorry()
|
|
{
|
|
echo "Sorry. I do not know how to flush the DNS on this OS."
|
|
echo "Once you find out, edit $(readlink ${0})."
|
|
exit 1
|
|
}
|
|
|
|
case ${OS} in
|
|
Darwin) case ${REL} in
|
|
14.*) sudo discoveryutil udnsflushcaches
|
|
;;
|
|
13.*) sudo pkill mDNS
|
|
;;
|
|
*) sorry
|
|
;;
|
|
esac
|
|
;;
|
|
|
|
*) sorry
|
|
;;
|
|
esac
|
|
|
|
exit 0
|