Commit 1fa570b3 authored by Franco Fichtner's avatar Franco Fichtner

inc: remove safe_mkdir() because simplicity

parent cf3977b7
...@@ -1285,12 +1285,10 @@ function openvpn_refresh_crls() { ...@@ -1285,12 +1285,10 @@ function openvpn_refresh_crls() {
} }
} }
function openvpn_create_dirs() { function openvpn_create_dirs()
global $g; {
if (!is_dir("{$g['varetc_path']}/openvpn")) @mkdir('/var/etc/openvpn-csc', 0750);
safe_mkdir("{$g['varetc_path']}/openvpn", 0750); @mkdir('/var/etc/openvpn', 0750);
if (!is_dir("{$g['varetc_path']}/openvpn-csc"))
safe_mkdir("{$g['varetc_path']}/openvpn-csc", 0750);
} }
function openvpn_get_interface_ip($ip, $mask) { function openvpn_get_interface_ip($ip, $mask) {
......
...@@ -1333,7 +1333,7 @@ function system_ntp_configure($start_ntpd = true) ...@@ -1333,7 +1333,7 @@ function system_ntp_configure($start_ntpd = true)
$statsdir = '/var/log/ntp'; $statsdir = '/var/log/ntp';
$gps_device = '/dev/gps0'; $gps_device = '/dev/gps0';
safe_mkdir($statsdir); @mkdir($statsdir, 0755);
if (!is_array($config['ntpd'])) { if (!is_array($config['ntpd'])) {
$config['ntpd'] = array(); $config['ntpd'] = array();
......
...@@ -1279,19 +1279,6 @@ function return_dir_as_array($dir, $filter_regex = '') { ...@@ -1279,19 +1279,6 @@ function return_dir_as_array($dir, $filter_regex = '') {
return $dir_array; return $dir_array;
} }
/*
* safe_mkdir($path, $mode = 0755)
* create directory if it doesn't already exist and isn't a file!
*/
function safe_mkdir($path, $mode= 0755)
{
if (!is_file($path) && !is_dir($path)) {
return @mkdir($path, $mode, true);
} else {
return false;
}
}
/* /*
* get_sysctl($names) * get_sysctl($names)
* Get values of sysctl OID's listed in $names (accepts an array or a single * Get values of sysctl OID's listed in $names (accepts an array or a single
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment