Updated to integrate cron autostart with the stock wz_mini.conf file as well as eliminated the old DNS solution.

This commit is contained in:
sideup66 2022-07-31 15:44:08 -04:00
parent 9297121a98
commit 1059a4d0c8
6 changed files with 6 additions and 24 deletions

Binary file not shown.

Binary file not shown.

View File

@ -595,6 +595,11 @@ if [[ "$WEB_SERVER_ENABLED" == "true" ]]; then
httpd -p 80 -h /opt/wz_mini/www
fi
if [[ "$ENABLE_CRON" == "true" ]]; then
until ping -c1 www.google.com >/dev/null 2>&1; do :; done
/opt/wz_mini/tmp/.bin/crond -b -c /opt/wz_mini/etc/crontab/
fi
hostname_set
touch /opt/wz_mini/tmp/.wz_user_firstrun
pkill -f dumpload #Kill dumpload so it won't waste cpu or ram gathering cores and uploading them when something crashes

View File

@ -1,20 +0,0 @@
#!/bin/sh
##Verify the network is up before continuing
until ping -c1 www.google.com >/dev/null 2>&1; do :; done
FILE=/tmp/test_hosts
if test -f "$FILE"; then
#We just need to clear and re generate. rebuilding the file is kinda pointless and script may be used on long running cameras.
true > /tmp/test_hosts
echo 127.0.0.1 localhost >>/tmp/test_hosts
dns=$(cat /etc/resolv.conf | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -1)
server=$(nslookup c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com $dns | awk -F': ' 'NF==2 { print $2 } ' | head -1)
echo $server c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com >>/tmp/test_hosts
else
#generate the file and mount
touch /tmp/test_hosts
echo 127.0.0.1 localhost >>/tmp/test_hosts
dns=$(cat /etc/resolv.conf | egrep -o '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -1)
server=$(nslookup c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com $dns | awk -F': ' 'NF==2 { print $2 } ' | head -1)
echo $server c1ybkrkbr1j10x.credentials.iot.us-west-2.amazonaws.com >>/tmp/test_hosts
mount --bind /tmp/test_hosts /etc/hosts
fi

View File

@ -1,4 +0,0 @@
#!/bin/sh
##Verify the network is up before continuing
until ping -c1 www.google.com >/dev/null 2>&1; do :; done
/opt/wz_mini/tmp/.bin/crond -b -c /opt/wz_mini/etc/crontab/

View File

@ -80,6 +80,7 @@ DISABLE_MOTOR="false"
ENABLE_FSCK_ON_BOOT="false"
ENABLE_CAR_DRIVER="false"
ENABLE_LOCAL_DNS="false"
ENABLE_CRON="false"
#####DEBUG#####
#drops you to a shell via serial, doesn't load app_init.sh