mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
rc: refactor, add missing copyright header, rename
Scott committed this in 2005 so it is safe to assume the BSD license fits... See also: https://github.com/pfsense/pfsense/commit/fa94531eaba
This commit is contained in:
parent
c33af5b33f
commit
9121ee88ce
2
plist
2
plist
@ -1667,9 +1667,9 @@
|
||||
/usr/local/opnsense/www/themes/opnsense/build/images/favicon.png
|
||||
/usr/local/opnsense/www/themes/opnsense/build/images/icon-logo.svg
|
||||
/usr/local/sbin/3gstats.php
|
||||
/usr/local/sbin/beep.sh
|
||||
/usr/local/sbin/carp_service_status
|
||||
/usr/local/sbin/configctl
|
||||
/usr/local/sbin/opnsense-beep
|
||||
/usr/local/sbin/opnsense-importer
|
||||
/usr/local/sbin/opnsense-installer
|
||||
/usr/local/sbin/opnsense-shell
|
||||
|
||||
@ -1209,7 +1209,7 @@ function reset_factory_defaults($sync = true)
|
||||
mwexec('/bin/rm -fr /conf/* /var/log/* /root/.history');
|
||||
disable_security_checks();
|
||||
|
||||
mwexec('/usr/local/sbin/beep.sh stop');
|
||||
mwexec('/usr/local/sbin/opnsense-beep stop');
|
||||
|
||||
/* as we go through a special case directly shut down */
|
||||
$shutdown_cmd = '/sbin/shutdown -op now';
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/local/sbin/beep.sh start
|
||||
opnsense-beep start
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
/usr/local/sbin/beep.sh stop
|
||||
opnsense-beep stop
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
COMMAND=${1}
|
||||
NOTELENGTH=25
|
||||
|
||||
if [ -f /conf/config.xml ]; then
|
||||
if [ "$(/usr/bin/grep -c disablebeep /conf/config.xml)" != "0" ]; then
|
||||
exit;
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -c "/dev/speaker" ]; then
|
||||
if [ "${COMMAND}" = "start" ]; then
|
||||
/usr/local/bin/beep -p 500 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 400 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 600 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 800 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 800 $NOTELENGTH
|
||||
elif [ "${COMMAND}" = "stop" ]; then
|
||||
/usr/local/bin/beep -p 600 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 800 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 500 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 400 $NOTELENGTH
|
||||
/usr/local/bin/beep -p 400 $NOTELENGTH
|
||||
fi
|
||||
fi
|
||||
52
src/sbin/opnsense-beep
Executable file
52
src/sbin/opnsense-beep
Executable file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2020-2021 Franco Fichtner <franco@opnsense.org>
|
||||
# Copyright (C) 2005 Scott Ullrich <sullrich@gmail.com>
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
# AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
||||
# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
COMMAND=${1}
|
||||
|
||||
START="500 400 600 800 800"
|
||||
STOP="600 800 500 400 400"
|
||||
|
||||
if [ ! -c "/dev/speaker" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -f /conf/config.xml ]; then
|
||||
if [ "$(/usr/bin/grep -c disablebeep /conf/config.xml)" != "0" ]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
case "${COMMAND}" in
|
||||
start)
|
||||
for NOTE in ${START}; do /usr/local/bin/beep -p ${NOTE} 25; done
|
||||
;;
|
||||
stop)
|
||||
for NOTE in ${STOP}; do /usr/local/bin/beep -p ${NOTE} 25; done
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
Loading…
x
Reference in New Issue
Block a user