#!/bin/sh usage() { cat </dev/null | grep -v rd_metadata) [ "$CONTENT" = "1" -o "$CONTENT" = "2" ] && CONTENT="bank_$CONTENT" [ "$1" = activeversion -a -z "$CONTENT" ] && CONTENT=$(uci -q get env.var.friendly_sw_version_activebank) [ "$1" = passiveversion -a -z "$CONTENT" ] && CONTENT=$(uci -q get env.var.friendly_sw_version_passivebank) [ -z "$CONTENT" ] && CONTENT="Unknown" handle_content "$1" "$CONTENT" done fi [ $QUIET = N ] && echo if [ $QUIET = N -a -e /usr/lib/lua/processvendorinfo.lua ]; then if grep -q acsurl /usr/lib/lua/processvendorinfo.lua; then echo -e " == Booted firmware is ${GREEN}VULNERABLE${NC} to tch-exploit${NC} ==\n" else echo -e " !! ${ORANGE}WARNING${NC}: Booted firmware is ${RED}NOT VULNERABLE${NC} to tch-exploit${NC} !!\n" fi fi if [ $OPTIMAL -eq 2 ]; then [ $QUIET = N ] && echo -e " == Bank Plan is ${GREEN}OPTIMAL${NC} ==\n" exit 0 else if [ $QUIET = N ]; then if [ $BANKTABLE = Y ]; then echo -e " !! Current Bank Plan is ${RED}NOT OPTIMAL${NC} !!\n" set_optimal_bank_plan echo "or manually follow the instructions at:" echo "https://hack-technicolor.readthedocs.io/en/stable/Hacking/PostRoot/#bank-planning" echo echo "NOTE: If you are unable to set an optimal bank plan, you may need to do a complete" echo " reset of the device using the following command:" echo echo " mtd -r erase rootfs_data" echo echo " The device will reboot, and you WILL lose root, but you will be able to set" echo " the optimal bank plan after re-acquiring root." echo else echo -e " !! Current Bank Plan is ${ORANGE}SUB-OPTIMAL${NC} !!\n" echo echo "It is strongly recommended that you always boot from bank 2 on this device, and" echo "keep a rootable firmware in bank 1 for updating the bank 2 firmware." fi fi exit 1 fi