Skip to content

Commit

Permalink
rootdevice: fix progress bar
Browse files Browse the repository at this point in the history
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel committed May 14, 2019
1 parent 4dbf4ef commit ae7066c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
14 changes: 6 additions & 8 deletions decompressed/base/etc/init.d/rootdevice
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,18 @@ get_transformer() {
cmd="require('datamodel').get('$1')"
lua -e "$cmd"
}
#################################################

log_progress=0
restart_dnsmasq=0

####################LOG FUNCTION#################
logger_command() {
if [ "$debug" -eq 1 ]; then
logger -s -t "Root Script" "$1"
fi
if [ -z "$2" ]; then
log_progress=$((log_progress+1))
if [ -z "$2" ] && [ -n "log_progress" ]; then
log_progress=$((log_progress+1))
set_transformer "rpc.system.modgui.upgradegui.log_prog" $log_progress
set_transformer "rpc.system.modgui.upgradegui.log" "$1"
fi
}
#################################################
#################################################

transfer_bank() {
#This function will clone and switch banks
Expand Down Expand Up @@ -241,6 +235,10 @@ root() {
}

install_gui() {

[[ -z "$log_progress" ]] && log_progress=0
[[ -z "$restart_dnsmasq" ]] && restart_dnsmasq=0

logger -s -t 'Root Script' "Installing in progress..."

logger_command "Disable watchdog"
Expand Down
11 changes: 8 additions & 3 deletions decompressed/gui_file/etc/modgui_scripts/06_network.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
. /etc/init.d/rootdevice

check_isp_config() {
#Detect ISP based on cwmp settings (Italian only)
if [ -z "$(uci -q get modgui.var.isp_autodetect)" ]; then
Expand Down Expand Up @@ -301,6 +303,10 @@ unlock_ssh_wan_tiscali() {
fi
}

#THIS CHECK DEVICE TYPE AND INSTALL SPECIFIC FILE
device_type="$(uci get -q env.var.prod_friendly_name)"
kernel_ver="$(cat /proc/version | awk '{print $3}')"

check_isp_config
logger_command "Check and cleanup"
add_ipoe #this need to stay to make the wizard work correctly
Expand All @@ -321,8 +327,7 @@ logger_command "Attempt to clean the wansensing script from hardcoded interfaces
wan_sensing_clean #Wansensing clean utility
logger_command "Cleaning cups firewall rule..."
clean_cups_block_rule
[ "$device_type" == "MediaAccess TG789vac v2" ] && logger_command "Unlocking SSH for Tiscali firmware"
[ "$device_type" == "MediaAccess TG789vac v2" ] && unlock_ssh_wan_tiscali

[ "$device_type" == "MediaAccess TG789vac v2" ] && logger_command "Unlocking SSH for Tiscali firmware"
[ "$device_type" == "MediaAccess TG789vac v2" ] && unlock_ssh_wan_tiscali
logger_command "Checking if ISP is detected..."
check_isp_and_cwmp

0 comments on commit ae7066c

Please sign in to comment.