diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-09-26 10:57:09 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-09-26 10:57:09 -0300 |
commit | 4b489b16fc88fdd621c57e6865508f96b59fba0e (patch) | |
tree | 7c69cbbeff5b8625c5726b6bdeb9b21be1a7f19b /config | |
parent | e042a31553f079827e42f7c12de04735d2515808 (diff) | |
download | pfsense-packages-4b489b16fc88fdd621c57e6865508f96b59fba0e.tar.gz pfsense-packages-4b489b16fc88fdd621c57e6865508f96b59fba0e.tar.bz2 pfsense-packages-4b489b16fc88fdd621c57e6865508f96b59fba0e.zip |
Silence errors when creating directories, also create a symlink to /usr/local/etc/raddb
Diffstat (limited to 'config')
-rw-r--r-- | config/freeradius2/freeradius.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index a9e10c7e..df231821 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -81,10 +81,15 @@ function freeradius_install_command() { conf_mount_rw(); // We create here different folders for different counters. - if (!file_exists("/var/log/radacct/datacounter/")) { exec("mkdir /var/log/radacct/datacounter && mkdir /var/log/radacct/datacounter/daily && mkdir /var/log/radacct/datacounter/weekly && mkdir /var/log/radacct/datacounter/monthly && mkdir /var/log/radacct/datacounter/forever"); } - if (!file_exists("/var/log/radacct/timecounter/")) { exec("mkdir /var/log/radacct/timecounter"); } - - exec("mkdir " . FREERADIUS_ETC . "/raddb/scripts"); + @mkdir("/var/log/radacct/datacounter/daily", 0755, true); + @mkdir("/var/log/radacct/datacounter/weekly", 0755, true); + @mkdir("/var/log/radacct/datacounter/monthly", 0755, true); + @mkdir("/var/log/radacct/datacounter/forever", 0755, true); + @mkdir("/var/log/radacct/timecounter", 0755, true); + @mkdir(FREERADIUS_ETC . "/raddb/scripts", 0755, true); + + unlink_if_exists("/usr/local/etc/raddb"); + @symlink(FREERADIUS_ETC . "/raddb", "/usr/local/etc/raddb"); if (!file_exists("/var/log/radutmp")) { exec("touch /var/log/radutmp"); } if (!file_exists("/var/log/radwtmp")) { exec("touch /var/log/radwtmp"); } exec("chown -R root:wheel " . FREERADIUS_ETC . "/raddb && chown -R root:wheel {$frlib} && chown -R root:wheel /var/log/radacct"); |