Added app_net_ready option

This commit is contained in:
AGG2017 2024-02-17 20:09:08 -05:00
parent b7e2b73465
commit 2fa48971f0
18 changed files with 106 additions and 3 deletions

View file

@ -0,0 +1 @@
\x10\x87\x02\xe3@63492

View file

@ -0,0 +1 @@
\x10\x87\x02\xe3@63492

View file

@ -0,0 +1 @@
\x10\x87\x02\xe3@63492

View file

@ -0,0 +1 @@
\x20\x8e\x04\xe3@63492

View file

@ -0,0 +1 @@
\x20\x8e\x04\xe3@63492

View file

@ -0,0 +1 @@
\x20\x8e\x04\xe3@63492

View file

@ -0,0 +1 @@
\x30\x85\x07\xe3@63492

View file

@ -0,0 +1 @@
\x30\x85\x07\xe3@63492

View file

@ -0,0 +1 @@
\x30\x85\x07\xe3@63492

View file

@ -0,0 +1 @@
\x88\x83\x01\xe3@63492

View file

@ -0,0 +1 @@
\x88\x83\x01\xe3@63492

View file

@ -0,0 +1 @@
\x88\x83\x01\xe3@63492

View file

@ -0,0 +1 @@
\x60\x8a\x0e\xe3@63492

View file

@ -0,0 +1 @@
\x60\x8a\x0e\xe3@63492

View file

@ -0,0 +1 @@
\x60\x8a\x0e\xe3@63492

View file

@ -0,0 +1,81 @@
#!/bin/bash
# global definitions:
RED='\033[0;31m'
NC='\033[0m'
# check the parameters
if [ $# != 2 ]; then
echo "usage : $0 <project_root> <settings>"
exit 1
fi
project_root="$1"
settings="$2"
# check the required tools
app_version_tool=$(which app_version.sh)
app_model_tool=$(which app_model.sh)
TOOL_LIST="app_version.sh app_model.sh cut dd"
for tool_name in $TOOL_LIST; do
echo "Checking tool: $tool_name"
tool_path=$(which "$tool_name")
if [ -z "$tool_path" ]; then
local_tool_path="$project_root/TOOLS/$tool_name"
if [ ! -f "$local_tool_path" ]; then
echo -e "${RED}ERROR: Missing tool '$tool_name' ${NC}"
exit 2
else
if [ "$tool_name" == "app_version.sh" ]; then
app_version_tool="$local_tool_path"
fi
if [ "$tool_name" == "app_model.sh" ]; then
app_model_tool="$local_tool_path"
fi
fi
fi
done
# check the project root folder
if [ ! -d "$project_root" ]; then
echo -e "${RED}ERROR: Cannot find the folder '$project_root' ${NC}"
exit 3
fi
# check the target folder
target_folder="$project_root/unpacked/squashfs-root"
if [ ! -d "$target_folder" ]; then
echo -e "${RED}ERROR: Cannot find the target folder '$target_folder' ${NC}"
exit 4
fi
# try to find out the app version (like app_ver="309")
def_target="$project_root/unpacked/squashfs-root/app/app"
app_ver=$("$app_version_tool" "$def_target")
if [ $? != 0 ]; then
echo -e "${RED}ERROR: Cannot find the app version ${NC}"
exit 5
fi
# try to find out the model
app_model=$("$app_model_tool" "$def_target")
if [ $? != 0 ]; then
echo -e "${RED}ERROR: Cannot find the app model ${NC}"
exit 6
fi
# find if the selected setting file exists
settings_file="$project_root/RESOURCES/OPTIONS/app_net_ready/$settings/${app_ver}.${app_model}"
if [ ! -f "$settings_file" ]; then
echo -e "${RED}ERROR: Unsupported model and version! Cannot find the settings file '$settings_file' ${NC}"
exit 7
fi
# patch the app based on the model and the version
while read -r line; do
settings_data=$(echo -n "$line" | cut -d "@" -f 1)
settings_addr=$(echo -n "$line" | cut -d "@" -f 2)
printf "$settings_data" | dd of="$def_target" bs=1 seek="$settings_addr" conv=notrunc
done <"$settings_file"
exit 0

View file

@ -60,6 +60,12 @@ webcam="default" [python] [fswebcam]
# Always keep a copy of the original keys in case you want to go back to AC cloud
kobra_unleashed="localhost.mr-a.de"
# Patch the app to check the captive portal URLs less often (originally every 2s)
# It is used to detect if the internet connection is established and alive
# This patch will produce less unwanted web traffic if enabled
# Available settings are: 5s, 10s, 20s, 30s and 60s
app_net_ready="30s"
# Replace some of the app images
# Use it for one or more sets: app_images="set1" "set2" "set3"
#app_images="set1"

View file

@ -89,13 +89,14 @@ echo ""
# check if the auto update is possible
if [ -f "$installed_options" ]; then
root_pw=$(grep "root_access=" "$installed_options")
if [ -z "$root_pw" ] || [ "$root_pw" == 'root_access=""' ]; then
echo "Root access option is not installed and the auto update is not possible. Please use the USB update procedure."
ssh_option=$(grep "ssh=" "$installed_options")
if [ -z "$root_pw" ] || [ "$root_pw" == 'root_access=""' ] || [ -z "$ssh_option" ]; then
echo -e "Root access option is not installed, the root password is empty or the ssh is disabled.\nThe auto update is not possible. Please use the USB update procedure."
else
# Ask if the user wants to attempt to auto install the update. If yes then run the auto install script
read -r -p "Do you want to attempt to auto install the update? [y/N] " response
if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]]; then
# Run AUTO_UPDATE_TOOL
# Run the auto update tool
python3 "$AUTO_UPDATE_TOOL"
fi
fi