mirror of https://github.com/OpenIPC/firmware.git
commit
949aaf64c4
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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 goke "Check MAC for Xiongmai devices"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_goke -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_hisilicon -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -3,11 +3,26 @@
|
|||
DAEMON="majestic"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
DAEMON_ARGS=""
|
||||
DAEMON_ARGS="-s"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_hisilicon -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_hisilicon -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_hisilicon -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_hisilicon -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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"
|
||||
|
@ -22,24 +37,13 @@ start() {
|
|||
export TZ=$(cat /etc/TZ)
|
||||
load_hisilicon -i
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -56,12 +60,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,19 +8,7 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
# 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 novatek "Check MAC for Novatek devices"
|
||||
#if [ "$(fw_printenv -n ethaddr)" = "D0:22:12:88:88:88" ]; then
|
||||
# logger -s -p daemon.info -t novatek "The eth0 interface has a lousy MAC, let's try to change it.."
|
||||
#else
|
||||
# logger -s -p daemon.info -t novatek "The eth0 interface has a correct MAC - $(fw_printenv -n ethaddr)"
|
||||
#fi
|
||||
#
|
||||
logger -s -p daemon.info -t novatek "Loading of kernel modules and initialization of the video system has started"
|
||||
export TZ=$(cat /etc/TZ)
|
||||
load_novatek -i
|
||||
#
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
|
@ -35,10 +23,26 @@ start() {
|
|||
return "$status"
|
||||
}
|
||||
|
||||
# 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 novatek "Check MAC for Novatek devices"
|
||||
#if [ "$(fw_printenv -n ethaddr)" = "D0:22:12:88:88:88" ]; then
|
||||
# logger -s -p daemon.info -t novatek "The eth0 interface has a lousy MAC, let's try to change it.."
|
||||
#else
|
||||
# logger -s -p daemon.info -t novatek "The eth0 interface has a correct MAC - $(fw_printenv -n ethaddr)"
|
||||
#fi
|
||||
#
|
||||
logger -s -p daemon.info -t novatek "Loading of kernel modules and initialization of the video system has started"
|
||||
export TZ=$(cat /etc/TZ)
|
||||
load_novatek -i
|
||||
#
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -55,12 +59,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,19 +8,7 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
# 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
|
||||
#
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
|
@ -35,10 +23,26 @@ start() {
|
|||
return "$status"
|
||||
}
|
||||
|
||||
# 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
|
||||
#
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -55,13 +59,14 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
esac
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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 xiongmai "Check MAC for Xiongmai devices"
|
||||
|
@ -25,24 +40,13 @@ start() {
|
|||
SNS_TYPE=$(ipcinfo --short_sensor)
|
||||
logger -s -p daemon.info -t xiongmai "You sensor is $SNS_TYPE"
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -59,12 +63,13 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
|
|
|
@ -8,6 +8,21 @@ DAEMON_ARGS="-s"
|
|||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
|
||||
|
||||
load_majestic() {
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
# 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 xiongmai "Check MAC for Xiongmai devices"
|
||||
|
@ -39,24 +54,13 @@ start() {
|
|||
esac
|
||||
fi
|
||||
#
|
||||
printf 'Starting %s: ' "$DAEMON"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
start-stop-daemon -b -m -S -q -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
|
||||
-- $DAEMON_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
load_majestic
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
[ -f /usr/sbin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -q -p "$PIDFILE"
|
||||
[ -f /usr/bin/$DAEMON ] || echo -en "DISABLED, "
|
||||
start-stop-daemon -K -s 9 -q -p "$PIDFILE"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
|
@ -73,13 +77,15 @@ restart() {
|
|||
start
|
||||
}
|
||||
|
||||
reload() {
|
||||
load_majestic
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|restart)
|
||||
start|stop|restart|reload)
|
||||
"$1";;
|
||||
reload)
|
||||
# Restart, since there is no true "reload" feature.
|
||||
restart;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in New Issue