mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-26 04:36:33 +00:00
reduced samba log level; raspberrypi(2): added brownout detection script
This commit is contained in:
parent
08cc0a73da
commit
1d93edc67d
@ -12,6 +12,8 @@
|
|||||||
printing = bsd
|
printing = bsd
|
||||||
printcap name = /dev/null
|
printcap name = /dev/null
|
||||||
disable spoolss = yes
|
disable spoolss = yes
|
||||||
|
log level = 0
|
||||||
|
syslog = 0
|
||||||
|
|
||||||
[sdcard]
|
[sdcard]
|
||||||
comment = SD Card Output Directory
|
comment = SD Card Output Directory
|
||||||
|
41
board/raspberrypi/overlay/etc/init.d/S03brownout
Executable file
41
board/raspberrypi/overlay/etc/init.d/S03brownout
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gpio=35
|
||||||
|
check_interval=30
|
||||||
|
export=/sys/class/gpio/export
|
||||||
|
read=/sys/class/gpio/gpio$gpio/value
|
||||||
|
|
||||||
|
configure() {
|
||||||
|
echo $gpio > $export
|
||||||
|
}
|
||||||
|
|
||||||
|
watch() {
|
||||||
|
while true; do
|
||||||
|
if [ `cat $read` == "0" ]; then
|
||||||
|
logger -t brownout -s "low power supply voltage detected"
|
||||||
|
fi
|
||||||
|
sleep $check_interval
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting brownout detector: "
|
||||||
|
configure
|
||||||
|
watch &
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
echo -n "Stopping brownout detector: "
|
||||||
|
ps | grep brownout | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
||||||
|
|
41
board/raspberrypi2/overlay/etc/init.d/S03brownout
Executable file
41
board/raspberrypi2/overlay/etc/init.d/S03brownout
Executable file
@ -0,0 +1,41 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
gpio=35
|
||||||
|
check_interval=30
|
||||||
|
export=/sys/class/gpio/export
|
||||||
|
read=/sys/class/gpio/gpio$gpio/value
|
||||||
|
|
||||||
|
configure() {
|
||||||
|
echo $gpio > $export
|
||||||
|
}
|
||||||
|
|
||||||
|
watch() {
|
||||||
|
while true; do
|
||||||
|
if [ `cat $read` == "0" ]; then
|
||||||
|
logger -t brownout -s "low power supply voltage detected"
|
||||||
|
fi
|
||||||
|
sleep $check_interval
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting brownout detector: "
|
||||||
|
configure
|
||||||
|
watch &
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
echo -n "Stopping brownout detector: "
|
||||||
|
ps | grep brownout | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill
|
||||||
|
echo "done"
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user