diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc index b0a93a2608..da39c39e58 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 e2245190f5..574bd51aa7 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 6f4e4772e0..eeefc55ac6 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 a843c7cea3..88f022a189 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 @@ -394,6 +403,15 @@ function prot_change() { ?> +