Cosmetic changes

pull/35/head
Igor Zalatov (via Araneus server) 2021-07-11 19:06:09 +03:00
parent 837637b7be
commit fe7659170b
2 changed files with 13 additions and 6 deletions

View File

@ -3,12 +3,12 @@
DAEMON="majestic"
PIDFILE="/var/run/$DAEMON.pid"
MAJESTIC_ARGS=""
DAEMON_ARGS=""
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
# The majestic does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one.
# The daemon does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one.
start() {
logger -s -p daemon.info -t hisilicon "Check MAC for Xiongmai devices"
if [ "$(fw_printenv -n ethaddr)" = "00:00:23:34:45:66" ]; then
@ -25,7 +25,7 @@ start() {
printf 'Starting %s: ' "$DAEMON"
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $MAJESTIC_ARGS
-- $DAEMON_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"

View File

@ -3,13 +3,20 @@
DAEMON="majestic"
PIDFILE="/var/run/$DAEMON.pid"
MAJESTIC_ARGS=""
DAEMON_ARGS=""
# shellcheck source=/dev/null
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
# The majestic does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one.
# The daemon does not create a pidfile, and use "-m" to instruct start-stop-daemon to create one.
start() {
logger -s -p daemon.info -t sigmastar "Check MAC for Sigmastar devices"
if [ "$(fw_printenv -n ethaddr)" = "D0:22:12:88:88:88" ]; then
logger -s -p daemon.info -t sigmastar "The eth0 interface has a lousy MAC, let's try to change it.."
else
logger -s -p daemon.info -t sigmastar "The eth0 interface has a correct MAC - $(fw_printenv -n ethaddr)"
fi
#
logger -s -p daemon.info -t sigmastar "Loading of kernel modules and initialization of the video system has started"
export TZ=$(cat /etc/TZ)
load_sigmastar -i
@ -17,7 +24,7 @@ start() {
printf 'Starting %s: ' "$DAEMON"
# shellcheck disable=SC2086 # we need the word splitting
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
-- $MAJESTIC_ARGS
-- $DAEMON_ARGS
status=$?
if [ "$status" -eq 0 ]; then
echo "OK"