mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
Init scripts: use test -s to test conf file sizes
This commit is contained in:
parent
68d509147d
commit
49139f3d61
@ -28,7 +28,7 @@ case "$1" in
|
|||||||
done
|
done
|
||||||
|
|
||||||
# source os_conf again, as it might have changed after restore
|
# source os_conf again, as it might have changed after restore
|
||||||
test -f /etc/init.d/os_conf && source /etc/init.d/os_conf
|
test -s /etc/init.d/os_conf && source /etc/init.d/os_conf
|
||||||
if [[ "${OS_DEBUG}" != "true" ]]; then
|
if [[ "${OS_DEBUG}" != "true" ]]; then
|
||||||
mount -o remount,ro /boot
|
mount -o remount,ro /boot
|
||||||
fi
|
fi
|
||||||
|
@ -17,9 +17,9 @@ fi
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
msg_begin "Applying sysctl parameters"
|
msg_begin "Applying sysctl parameters"
|
||||||
test -f ${SYS_CONF} && sysctl -q -p ${SYS_CONF}
|
test -s ${SYS_CONF} && sysctl -q -p ${SYS_CONF}
|
||||||
test -f ${CONF} && sysctl -q -p ${CONF}
|
test -s ${CONF} && sysctl -q -p ${CONF}
|
||||||
test -f ${BOOT_CONF} && sysctl -q -p ${BOOT_CONF}
|
test -s ${BOOT_CONF} && sysctl -q -p ${BOOT_CONF}
|
||||||
msg_done
|
msg_done
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ PROG_UA="/sbin/udevadm"
|
|||||||
|
|
||||||
|
|
||||||
test -f ${PROG} || exit 0
|
test -f ${PROG} || exit 0
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ PROG_UA="/usr/bin/udevadm"
|
|||||||
test -x ${PROG} || exit 0
|
test -x ${PROG} || exit 0
|
||||||
|
|
||||||
# dbus is currently only used by bluez
|
# dbus is currently only used by bluez
|
||||||
test -f ${BTCONF} || test -f ${BOOT_BTCONF} || test -f ${SYS_BTCONF} || exit 0
|
test -s ${BTCONF} || test -s ${BOOT_BTCONF} || test -s ${SYS_BTCONF} || exit 0
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
|
@ -18,9 +18,9 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
test -f ${WATCH_CONF} && source ${WATCH_CONF}
|
test -s ${WATCH_CONF} && source ${WATCH_CONF}
|
||||||
|
|
||||||
|
|
||||||
running() {
|
running() {
|
||||||
|
@ -21,7 +21,7 @@ prepare_conf ${WATCH_CONF} ${SYS_WATCH_CONF} ${BOOT_WATCH_CONF}
|
|||||||
source ${WATCH_CONF}
|
source ${WATCH_CONF}
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
ssid=$(cat ${CONF} | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
|
ssid=$(cat ${CONF} | grep ssid | grep -v scan_ssid | cut -d '"' -f 2)
|
||||||
test -n "${ssid}" || exit 0
|
test -n "${ssid}" || exit 0
|
||||||
|
@ -17,7 +17,7 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
|
@ -8,7 +8,7 @@ NETWATCH_INTERVAL=20
|
|||||||
|
|
||||||
# watch configuration is already prepared by wifi init script
|
# watch configuration is already prepared by wifi init script
|
||||||
|
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
source ${CONF}
|
source ${CONF}
|
||||||
|
|
||||||
test -n "${NETWATCH_HOST}" || exit 0
|
test -n "${NETWATCH_HOST}" || exit 0
|
||||||
|
@ -8,7 +8,7 @@ CONF="/data/etc/firewall.sh"
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
@ -13,7 +13,7 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
@ -18,7 +18,7 @@ test -n "${OS_VERSION}" || source /etc/init.d/base
|
|||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
prepare_conf ${NTP_CONF} ${SYS_NTP_CONF} ${BOOT_NTP_CONF}
|
prepare_conf ${NTP_CONF} ${SYS_NTP_CONF} ${BOOT_NTP_CONF}
|
||||||
|
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
test "${OS_NETWORKLESS}" == "true" && exit 0
|
test "${OS_NETWORKLESS}" == "true" && exit 0
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ test -x ${PROG} || exit 0
|
|||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
test "${OS_NETWORKLESS}" == "true" && exit 0
|
test "${OS_NETWORKLESS}" == "true" && exit 0
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
test -n "${OS_DEBUG}" || source /etc/init.d/conf
|
test -n "${OS_DEBUG}" || source /etc/init.d/conf
|
||||||
|
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
test "${OS_NETWORKLESS}" == "true" && exit 0
|
test "${OS_NETWORKLESS}" == "true" && exit 0
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
test -n "${OS_DEBUG}" || source /etc/init.d/conf
|
test -n "${OS_DEBUG}" || source /etc/init.d/conf
|
||||||
|
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
test "${OS_NETWORKLESS}" == "true" && exit 0
|
test "${OS_NETWORKLESS}" == "true" && exit 0
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
@ -12,7 +12,7 @@ test -x ${PROG} || exit 0
|
|||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||||
test -f ${CONF} || exit 0
|
test -s ${CONF} || exit 0
|
||||||
|
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
USERINIT="/data/etc/userinit.sh"
|
USERINIT="/data/etc/userinit.sh"
|
||||||
|
|
||||||
|
|
||||||
test -f ${USERINIT} || exit 0
|
test -s ${USERINIT} || exit 0
|
||||||
|
|
||||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ TMP_BOOT_LOG=/tmp/_boot.log
|
|||||||
PID_FILE=/tmp/rc.pid
|
PID_FILE=/tmp/rc.pid
|
||||||
|
|
||||||
set -a
|
set -a
|
||||||
test -f /etc/environment && source /etc/environment
|
test -s /etc/environment && source /etc/environment
|
||||||
test -f /data/etc/environment && source /data/etc/environment
|
test -s /data/etc/environment && source /data/etc/environment
|
||||||
test -f /boot/etc/environment && source /boot/etc/environment
|
test -s /boot/etc/environment && source /boot/etc/environment
|
||||||
set +a
|
set +a
|
||||||
|
|
||||||
source /etc/init.d/base
|
source /etc/init.d/base
|
||||||
|
Loading…
x
Reference in New Issue
Block a user