summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Buechler <cmb@pfsense.org>2012-02-22 21:37:59 -0800
committerChris Buechler <cmb@pfsense.org>2012-02-22 21:37:59 -0800
commita2263f0cd8b655922ea8a66b3b93a6062539ea99 (patch)
treeaf43729ad348325d2badd1dede3539eeaad88ad4
parent1b9c5e4d0086b0285df3f4c5f51aa062fb584530 (diff)
parent5e4d70a08270f842daff7c6167d9bad56fff593f (diff)
downloadpfsense-a2263f0cd8b655922ea8a66b3b93a6062539ea99.zip
pfsense-a2263f0cd8b655922ea8a66b3b93a6062539ea99.tar.gz
Merge pull request #56 from yakatz/beep
Option to disable startup/shutdown sounds
-rw-r--r--etc/inc/pfsense-utils.inc23
-rwxr-xr-xetc/rc.bootup3
-rwxr-xr-xusr/local/bin/beep.sh4
-rw-r--r--usr/local/www/system_advanced_admin.php18
4 files changed, 48 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index b0a93a2..da39c39 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -927,6 +927,29 @@ function auto_login() {
conf_mount_ro();
}
+function setup_beep() {
+ global $config;
+
+ if(isset($config['system']['disablebeep']))
+ $status = false;
+ else
+ $status = true;
+
+ $beep_file = "/etc/disable_beep";
+
+ conf_mount_rw();
+
+ if($status == false) {
+ touch($beep_file);
+ } else {
+ if (file_exists($beep_file)) {
+ unlink($beep_file);
+ }
+ }
+
+ conf_mount_ro();
+}
+
function setup_serial_port($when="save", $path="") {
global $g, $config;
conf_mount_rw();
diff --git a/etc/rc.bootup b/etc/rc.bootup
index e224519..574bd51 100755
--- a/etc/rc.bootup
+++ b/etc/rc.bootup
@@ -360,6 +360,9 @@ system_set_harddisk_standby();
/* lock down console if necessary */
auto_login();
+/* disable beep.sh if configured */
+setup_beep();
+
/* load graphing functions */
enable_rrd_graphing();
diff --git a/usr/local/bin/beep.sh b/usr/local/bin/beep.sh
index 6f4e477..eeefc55 100755
--- a/usr/local/bin/beep.sh
+++ b/usr/local/bin/beep.sh
@@ -1,5 +1,9 @@
#!/bin/sh
+if [ -f /etc/disable_beep ]; then
+ exit;
+fi
+
# Standard note length
NOTELENGTH="25"
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php
index a843c7c..88f022a 100644
--- a/usr/local/www/system_advanced_admin.php
+++ b/usr/local/www/system_advanced_admin.php
@@ -55,6 +55,7 @@ $pconfig['max_procs'] = ($config['system']['webgui']['max_procs']) ? $config['sy
$pconfig['ssl-certref'] = $config['system']['webgui']['ssl-certref'];
$pconfig['disablehttpredirect'] = isset($config['system']['webgui']['disablehttpredirect']);
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
+$pconfig['disablebeep'] = isset($config['system']['disablebeep']);
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
$pconfig['nodnsrebindcheck'] = isset($config['system']['webgui']['nodnsrebindcheck']);
$pconfig['nohttpreferercheck'] = isset($config['system']['webgui']['nohttpreferercheck']);
@@ -141,6 +142,14 @@ if ($_POST) {
auto_login();
}
+ if($_POST['disablebeep'] == "yes") {
+ $config['system']['disablebeep'] = true;
+ setup_beep();
+ } else {
+ unset($config['system']['disablebeep']);
+ setup_beep();
+ }
+
if ($_POST['noantilockout'] == "yes")
$config['system']['webgui']['noantilockout'] = true;
else
@@ -395,6 +404,15 @@ function prot_change() {
</td>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Startup/Showtdown Sound"); ?></td>
+ <td width="78%" class="vtable">
+ <input name="disablebeep" type="checkbox" id="disablebeep" value="yes" <?php if ($pconfig['disablebeep']) echo "checked"; ?> />
+ <strong><?=gettext("Disable the startup/shutdown beep"); ?></strong>
+ <br/>
+ <span class="vexpl"><?=gettext("When this is checked, startup and shutdown sounds will no longer play."); ?></span>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Anti-lockout"); ?></td>
<td width="78%" class="vtable">
<?php
OpenPOWER on IntegriCloud