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