Files
wyze-firmware/SD_ROOT/wz_mini/etc/rc.common
T
gtxaspec 9ce6bbd92a New init system (#216)
* new init system

* update new init scripts

* update checksum

* fix broken audio promps with new init scripts

* fix debug/upgrade mode

* fix bonding and eth0 hw addr

* add checksum

* fix bonding setup

* add rtsp auth disable

* adjust network init scripts path

* recreated repo and re added cron scripts (#211)

* recreated repo and re added cron scripts

* rename cron script and move it to the right folder.

* Delete .vs directory

remove .vs directory

* add deubg message to bonding rc.d script

* add crontab variable to wz_mini.conf

* fix mp4write

* add syslog debug feature

* fix syslog init blocking

* fix syslog save function

* increase imp_helper rerun delay

* update init scripts

* fix bonding and usb-direct

* update checksum

* add netmon for bonding

* fix supervisor function

* update model detection

* fix debugging injection on T20 devices

Co-authored-by: sideup66 <47700565+sideup66@users.noreply.github.com>
2022-08-07 18:46:00 -07:00

82 líneas
1.6 KiB
Bash
Archivo Ejecutable

#!/bin/sh
source /opt/wz_mini/wz_mini.conf
#Set module dir depending on platform
if [ -f /opt/wz_mini/tmp/.T20 ]; then
KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14"
else
KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__"
fi
if [[ "$ENABLE_USB_ETH" == "true" ]]; then
ALT_IFACE=eth0
elif [[ "$ENABLE_USB_DIRECT" == "true" ]] || [[ "$ENABLE_USB_RNDIS" == "true" ]]; then
ALT_IFACE=usb0
fi
#Set the correct GPIO for the audio driver (T31 only)
if [ -f /opt/wz_mini/tmp/.HL_PAN2 ]; then
GPIO=7
elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
GPIO=63
fi
wait_for_wlan() {
while true; do
if ifconfig wlan0 | grep "HWaddr" > /dev/null; then
break
fi
echo "$1: Network HW not ready yet, try again in 5 seconds"
sleep 5
done
}
wait_for_wlan_wpa() {
while true; do
if [ -e /tmp/wpa_supplicant.conf ]; then
break
fi
echo "$1: wpa_supplicant not initialized yet, try again in 5 seconds"
sleep 5
done
}
wait_for_wlan_ip() {
while true; do
if ifconfig wlan0 | grep "inet addr" > /dev/null; then
break
fi
echo "$1: IP Address not acquired yet, try again in 5 seconds"
sleep 5
done
}
wait_for_icamera() {
while ! pgrep -f "/system/bin/iCamera" > /dev/null; do
sleep 5
done
}
gateway_supervisor() {
count=0
while [ true ]; do
if ! ping -c1 -W 2 `/opt/wz_mini/bin/busybox ip route | awk '/default/ { print $3 }'` >& /dev/null; then
echo "$1: Unable to reach default route via USB Direct Link, ifdown usb0..."
count=0
ifconfig usb0 down
sleep 10
else
if [[ $count -ne 1 ]]
then
#echo "Connected."
count=1
sleep 5
fi
sleep 1
fi
done
}