summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-28 09:28:24 -0300
committerRenato Botelho <renato@netgate.com>2015-08-28 09:28:24 -0300
commit53ca09c8f155e983a9804a52319fb5c87f28900f (patch)
treec936470792742976c2d335cf29cadde1055aa718 /src
parent1fe88d807c9b618413495e64dc99026bd0d74d11 (diff)
parent0357ecfc68c734384ea890929085c04605204666 (diff)
downloadpfsense-53ca09c8f155e983a9804a52319fb5c87f28900f.zip
pfsense-53ca09c8f155e983a9804a52319fb5c87f28900f.tar.gz
Merge pull request #1830 from doktornotor/patch-6
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/system.inc17
-rw-r--r--src/usr/local/www/system_advanced_misc.php2
2 files changed, 13 insertions, 6 deletions
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 41e798e..f7987e1 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -2042,6 +2042,7 @@ function system_dmesg_save() {
function system_set_harddisk_standby() {
global $g, $config;
+
if (isset($config['system']['developerspew'])) {
$mt = microtime();
echo "system_set_harddisk_standby() being called $mt\n";
@@ -2055,11 +2056,17 @@ function system_set_harddisk_standby() {
$standby = $config['system']['harddiskstandby'];
// Check for a numeric value
if (is_numeric($standby)) {
- // Sync the disk(s)
- pfSense_sync();
- if (set_single_sysctl('hw.ata.standby', (int)$standby)) {
- // Reinitialize ATA-drives
- mwexec('/usr/local/sbin/atareinit');
+ // Get only suitable candidates for standby; using get_smart_drive_list()
+ // from utils.inc to get the list of drives.
+ $harddisks = get_smart_drive_list();
+
+ // Since get_smart_drive_list() only matches ad|da|ada; lets put the check below
+ // just in case of some weird pfSense platform installs.
+ if (count($harddisks) > 0) {
+ // Iterate disks and run the camcontrol command for each
+ foreach ($harddisks as $harddisk) {
+ mwexec("/sbin/camcontrol standby {$harddisk} -t {$standby}");
+ }
if (platform_booting()) {
echo gettext("done.") . "\n";
}
diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php
index 72f4833..bd16f1d 100644
--- a/src/usr/local/www/system_advanced_misc.php
+++ b/src/usr/local/www/system_advanced_misc.php
@@ -667,7 +667,7 @@ function tmpvar_checked(obj) {
<tr>
<td colspan="2" class="list" height="12">&nbsp;</td>
</tr>
- <?php if ($g['platform'] == "pfSenseDISABLED"): ?>
+ <?php if ($g['platform'] == "pfSense"): ?>
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Hardware Settings"); ?></td>
</tr>
OpenPOWER on IntegriCloud