summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-01-15 10:40:01 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-01-15 10:40:01 +0000
commit413350ce5285149471a06eee99743b43a3ad779d (patch)
tree8ab758a6a52b38d43a2cb0d6b3f3159d9dae22d7
parenta5f0463a95e23ad3d1b7c64f8f080ce4cb0debbf (diff)
downloadpfsense-413350ce5285149471a06eee99743b43a3ad779d.zip
pfsense-413350ce5285149471a06eee99743b43a3ad779d.tar.gz
Add back safe_mkdir!?
-rw-r--r--etc/inc/pfsense-utils.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index dd56e4d..a94ac8b 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -45,6 +45,22 @@ if($g['platform'] == "pfSense") {
safe_mkdir("/usr/local/pkg/pf");
}
+/*
+ * safe_mkdir($path, $mode = 0755)
+ * create directory if it doesn't already exist and isn't a file!
+ */
+function safe_mkdir($path, $mode=0755) {
+ global $g;
+
+ /* cdrom is ro. */
+ if($g['platform'] == "cdrom")
+ return false;
+
+ if (!is_file($path) && !is_dir($path))
+ return mkdir($path, $mode);
+ else
+ return false;
+}
/****f* pkg-utils/is_package_installed
* NAME
OpenPOWER on IntegriCloud