boB Rudis
4 years ago
4 changed files with 30 additions and 2 deletions
@ -0,0 +1,11 @@ |
|||||
|
#' Is the internet accessible? |
||||
|
#' |
||||
|
#' @param fqdn_or_ip FQDN or ip to use for reachability testing. defaults to google dns |
||||
|
#' @export |
||||
|
reachable <- function(fqdn_or_ip = "8.8.8.8") { |
||||
|
|
||||
|
res <- sys::exec_internal("/usr/sbin/scutil", args = c("-r", fqdn_or_ip[1])) |
||||
|
|
||||
|
return(res$status == 0) |
||||
|
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
% Generated by roxygen2: do not edit by hand |
||||
|
% Please edit documentation in R/reachable.R |
||||
|
\name{reachable} |
||||
|
\alias{reachable} |
||||
|
\title{Is the internet accessible?} |
||||
|
\usage{ |
||||
|
reachable(fqdn_or_ip = "8.8.8.8") |
||||
|
} |
||||
|
\arguments{ |
||||
|
\item{fqdn_or_ip}{FQDN or ip to use for reachability testing. defaults to google dns} |
||||
|
} |
||||
|
\description{ |
||||
|
Is the internet accessible? |
||||
|
} |
Loading…
Reference in new issue