mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-24 11:46:30 +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
|
||||
|
||||
# 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
|
||||
mount -o remount,ro /boot
|
||||
fi
|
||||
|
@ -17,9 +17,9 @@ fi
|
||||
case "$1" in
|
||||
start)
|
||||
msg_begin "Applying sysctl parameters"
|
||||
test -f ${SYS_CONF} && sysctl -q -p ${SYS_CONF}
|
||||
test -f ${CONF} && sysctl -q -p ${CONF}
|
||||
test -f ${BOOT_CONF} && sysctl -q -p ${BOOT_CONF}
|
||||
test -s ${SYS_CONF} && sysctl -q -p ${SYS_CONF}
|
||||
test -s ${CONF} && sysctl -q -p ${CONF}
|
||||
test -s ${BOOT_CONF} && sysctl -q -p ${BOOT_CONF}
|
||||
msg_done
|
||||
;;
|
||||
|
||||
|
@ -6,7 +6,7 @@ PROG_UA="/sbin/udevadm"
|
||||
|
||||
|
||||
test -f ${PROG} || exit 0
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
|
@ -12,7 +12,7 @@ PROG_UA="/usr/bin/udevadm"
|
||||
test -x ${PROG} || exit 0
|
||||
|
||||
# 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
|
||||
|
||||
|
@ -18,9 +18,9 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
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() {
|
||||
|
@ -21,7 +21,7 @@ prepare_conf ${WATCH_CONF} ${SYS_WATCH_CONF} ${BOOT_WATCH_CONF}
|
||||
source ${WATCH_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)
|
||||
test -n "${ssid}" || exit 0
|
||||
|
@ -17,7 +17,7 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
|
||||
|
||||
configure() {
|
||||
@ -26,7 +26,7 @@ configure() {
|
||||
cp ${CONF} ${RUN_CONF}
|
||||
|
||||
# if no specific name configured, use hostname
|
||||
if ! grep -E 'Name\s*=' ${RUN_CONF} &>/dev/null; then
|
||||
if ! grep -E 'Name\s*=' ${RUN_CONF} &>/dev/null; then
|
||||
sed -ri "s/(\[General\])/\1\nName = $(hostname)/" ${RUN_CONF}
|
||||
fi
|
||||
|
||||
|
@ -8,7 +8,7 @@ NETWATCH_INTERVAL=20
|
||||
|
||||
# watch configuration is already prepared by wifi init script
|
||||
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
source ${CONF}
|
||||
|
||||
test -n "${NETWATCH_HOST}" || exit 0
|
||||
|
@ -8,7 +8,7 @@ CONF="/data/etc/firewall.sh"
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
|
||||
|
||||
start() {
|
||||
|
@ -13,7 +13,7 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
|
||||
|
||||
start() {
|
||||
|
@ -18,7 +18,7 @@ test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_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
|
||||
|
||||
|
@ -10,7 +10,7 @@ test -x ${PROG} || exit 0
|
||||
|
||||
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
|
||||
|
||||
|
@ -9,7 +9,7 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
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
|
||||
|
||||
|
@ -11,7 +11,7 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
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
|
||||
|
||||
|
@ -12,7 +12,7 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
|
||||
|
||||
start() {
|
||||
|
@ -12,7 +12,7 @@ test -x ${PROG} || exit 0
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF}
|
||||
test -f ${CONF} || exit 0
|
||||
test -s ${CONF} || exit 0
|
||||
|
||||
|
||||
start() {
|
||||
|
@ -3,7 +3,7 @@
|
||||
USERINIT="/data/etc/userinit.sh"
|
||||
|
||||
|
||||
test -f ${USERINIT} || exit 0
|
||||
test -s ${USERINIT} || exit 0
|
||||
|
||||
test -n "${OS_VERSION}" || source /etc/init.d/base
|
||||
|
||||
|
@ -5,9 +5,9 @@ TMP_BOOT_LOG=/tmp/_boot.log
|
||||
PID_FILE=/tmp/rc.pid
|
||||
|
||||
set -a
|
||||
test -f /etc/environment && source /etc/environment
|
||||
test -f /data/etc/environment && source /data/etc/environment
|
||||
test -f /boot/etc/environment && source /boot/etc/environment
|
||||
test -s /etc/environment && source /etc/environment
|
||||
test -s /data/etc/environment && source /data/etc/environment
|
||||
test -s /boot/etc/environment && source /boot/etc/environment
|
||||
set +a
|
||||
|
||||
source /etc/init.d/base
|
||||
|
Loading…
x
Reference in New Issue
Block a user