diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-01-15 10:40:01 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-01-15 10:40:01 +0000 |
commit | 413350ce5285149471a06eee99743b43a3ad779d (patch) | |
tree | 8ab758a6a52b38d43a2cb0d6b3f3159d9dae22d7 | |
parent | a5f0463a95e23ad3d1b7c64f8f080ce4cb0debbf (diff) | |
download | pfsense-413350ce5285149471a06eee99743b43a3ad779d.zip pfsense-413350ce5285149471a06eee99743b43a3ad779d.tar.gz |
Add back safe_mkdir!?
-rw-r--r-- | etc/inc/pfsense-utils.inc | 16 |
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 |