summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-05-01 21:48:16 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-05-01 21:48:16 +0000
commit1038786286cb3ccfaf9b34b26d371f7c8e321c95 (patch)
tree54865311f4057469065aea8117b4d8bf1aa1e838 /etc
parentff66495424b65961cd379f6417814cf07061cbee (diff)
downloadpfsense-1038786286cb3ccfaf9b34b26d371f7c8e321c95.zip
pfsense-1038786286cb3ccfaf9b34b26d371f7c8e321c95.tar.gz
Add does_url_exist() which can verify a URL exists before downloading.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc18
1 files changed, 18 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index c857cf0..cee1a0f 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -33,6 +33,24 @@
*
*/
+/****f* pfsense-utils/does_url_exist
+ * NAME
+ * does_url_exist
+ * INPUTS
+ * none
+ * RESULT
+ * returns true if a url is available
+ ******/
+function does_url_exist($url) {
+ $fd = fopen("http://us3.php.net/manual/en/function.header.php","r");
+ fclose($fd);
+ if($fd) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
/****f* pfsense-utils/is_private_ip
* NAME
* is_private_ip
OpenPOWER on IntegriCloud