Skip to content

Commit

Permalink
add clean of VCNTD_502L07p1 url #1194
Browse files Browse the repository at this point in the history
improved some checks to be more POSIX sh compliant
  • Loading branch information
FrancYescO committed Jul 15, 2024
1 parent 7850275 commit b79dd45
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 20 deletions.
23 changes: 12 additions & 11 deletions decompressed/gui_file/etc/modgui_scripts/02_specific.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extract_with_check() {
if [ -f "$orig_file" ]; then
md5_file=$(md5sum "$file" | awk '{ print $1 }')
md5_orig_file=$(md5sum "$orig_file" | awk '{ print $1 }')
if [ "$md5_file" == "$md5_orig_file" ]; then
if [ "$md5_file" = "$md5_orig_file" ]; then
rm "$file"
continue
fi
Expand Down Expand Up @@ -55,7 +55,7 @@ apply_right_opkg_repo() {

opkg_file="/etc/opkg.conf"

if [ "$cpu_type" == "armv7l" ]; then
if [ "$cpu_type" = "armv7l" ]; then
case $marketing_version in
"19."*)
sed -i '/homeware\/18\/brcm63xx-tch/d' /etc/opkg.conf #remove old setted feeds
Expand Down Expand Up @@ -147,10 +147,10 @@ EOF
logecho "No known ARM feeds for this version $marketing_version"
;;
esac
elif [ "$cpu_type" == "mips" ]; then
elif [ "$cpu_type" = "mips" ]; then
case $marketing_version in
"16."* | "17."*)
if [ ! grep -q "$(grep $opkg_file -e "chaos_calmer/15.05.1/brcm63xx")" ]; then
if grep -q "chaos_calmer/15.05.1/brcm63xx" $opkg_file; then
sed -i '/FrancYescO\/789vacv2/d' /etc/opkg.conf #remove old setted feeds
cat <<EOF >>$opkg_file
src/gz chaos_calmer_base http://archive.openwrt.org/chaos_calmer/15.05.1/brcm63xx/generic/packages/base
Expand Down Expand Up @@ -178,6 +178,7 @@ EOF
[ -f /etc/opkg/distfeeds.conf ] && {
sed -i '/15.05.1\/brcm63xx-tch/d' /etc/opkg/distfeeds.conf
sed -i '/targets\/brcm6xxx-tch\/VBNTJ_502L07p1/d' /etc/opkg/distfeeds.conf
sed -i '/targets\/brcm6xxx-tch\/VCNTD_502L07p1/d' /etc/opkg/distfeeds.conf
}
}

Expand All @@ -192,7 +193,7 @@ ledfw_extract() {
}

ledfw_rework_TG788() {
if [ ! "$(uci get -q button.info)" ] || [ "$(uci get -q button.info)" == "BTN_3" ]; then
if [ ! "$(uci get -q button.info)" ] || [ "$(uci get -q button.info)" = "BTN_3" ]; then
logecho "Setting up status (wifi) button..."
uci del button.easy_reset
uci set button.info=button
Expand Down Expand Up @@ -280,18 +281,18 @@ fi
# and should be linked to the package download, make sure to reflect changes in the modal
case $marketing_version in
"16.1"* | "16.2"*)
[ "$cpu_type" == "armv7l" ] && install_specific TG789Xtream35B
[ "$cpu_type" == "mips" ] && install_specific TG789
[ "$cpu_type" = "armv7l" ] && install_specific TG789Xtream35B
[ "$cpu_type" = "mips" ] && install_specific TG789
;;
"16."* | "17."*)
[ "$cpu_type" == "armv7l" ] && {
[ "$cpu_type" = "armv7l" ] && {
[ -z "${device_type##*TG800*}" ] && install_specific TG800 || install_specific DGA
}
[ "$cpu_type" == "mips" ] && install_specific TG789
[ "$cpu_type" = "mips" ] && install_specific TG789
;;
"18."*)
[ "$cpu_type" == "armv7l" ] && install_specific DGA
[ "$cpu_type" == "mips" ] && logecho "Unknown what specific_app to install on $marketing_version $cpu_type"
[ "$cpu_type" = "armv7l" ] && install_specific DGA
[ "$cpu_type" = "mips" ] && logecho "Unknown what specific_app to install on $marketing_version $cpu_type"
;;
*)
uci set modgui.app.specific_app="1" #no specific package for this device
Expand Down
8 changes: 4 additions & 4 deletions decompressed/gui_file/etc/modgui_scripts/03_various.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ check_upgrade_shit() {

restore_original_mapper() {
logecho "Restoring and enabling few transformer mappers..."
local orig_dir=/rom/usr/share/transformer/mappings
local target=/usr/share/transformer/mappings
orig_dir=/rom/usr/share/transformer/mappings
target=/usr/share/transformer/mappings

if [ "$(md5sum $orig_dir/device2/Device.map | awk '{print $1}')" != "$(md5sum $target/device2/Device.map | awk '{print $1}')" ]; then
mkdir /tmp/tmp_bff_file
Expand Down Expand Up @@ -47,8 +47,8 @@ restore_original_mapper() {

transformer_lib_check() {
logecho "Transformer lib check"
local orig_dir=/rom/usr
local target=/usr
orig_dir=/rom/usr
target=/usr

if [ "$(md5sum $orig_dir/lib/lua/transformer/commitapply.lua | awk '{print $1}')" != "$(md5sum $target/lib/lua/transformer/commitapply.lua | awk '{print $1}')" ]; then
rm $target/share/transformer/mappings/rpc/*
Expand Down
2 changes: 1 addition & 1 deletion decompressed/gui_file/etc/modgui_scripts/04_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ real_ver_entitied() {
}

fix_fxs_date_display() {
if [ "$(uci get -q mmpbxbrcmfxsdev.fxs_dev_0.cid_display_date_enabled)" == "0" ]; then
if [ "$(uci get -q mmpbxbrcmfxsdev.fxs_dev_0.cid_display_date_enabled)" = "0" ]; then
logecho "Enabling time display over fxs ports"
uci set mmpbxbrcmfxsdev.fxs_dev_0.cid_display_date_enabled=1
uci set mmpbxbrcmfxsdev.fxs_dev_1.cid_display_date_enabled=1
Expand Down
2 changes: 1 addition & 1 deletion decompressed/gui_file/etc/modgui_scripts/05_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ telstra_support_check() {
uci set modgui.app.telstra_webui="0"
fi
if [ -f /tmp/telstra_gui.tar.bz2 ]; then
if [ "$(uci get -q modgui.app.telstra_webui)" == "1" ]; then
if [ "$(uci get -q modgui.app.telstra_webui)" = "1" ]; then
bzcat /tmp/telstra_gui.tar.bz2 | tar -C / -xf -
fi
rm /tmp/telstra_gui.tar.bz2
Expand Down
4 changes: 2 additions & 2 deletions decompressed/gui_file/etc/modgui_scripts/06_network.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ setup_network() {
uci -q set network.wanptm0.vid=835

#workaround to avoid who already setup the MST device vlan_wan on VLAN 835
[ "$(uci -q get network.vlan_wan.vid)" == "835" ] && uci -q set network.wanptm0.vid=836
[ "$(uci -q get network.vlan_wan.vid)" = "835" ] && uci -q set network.wanptm0.vid=836
fi
[ ! "$(uci -q get network.wanptm0.vid)" ] && uci -q set network.wanptm0.vid=835
[ ! "$(uci -q get network.wanptm0.ifname)" ] && uci -q set network.wanptm0.ifname=ptm0
Expand Down Expand Up @@ -255,7 +255,7 @@ check_dnsmasq_name #check dnsmasq name in uci to avoid issue in guid hardcoded
update_dhcp_config #DHCP sync
wan_sensing_clean #Wansensing clean utility
clean_cups_block_rule
[ "$device_type" == "MediaAccess TG789vac v2" ] && unlock_ssh_wan_tiscali
[ "$device_type" = "MediaAccess TG789vac v2" ] && unlock_ssh_wan_tiscali
disable_tcp_Sack
check_xtm_atmwan #needed for UNO firmware

Expand Down
2 changes: 1 addition & 1 deletion decompressed/gui_file/etc/modgui_scripts/99_postreq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ start_stop_nginx() {
done
}

if [ "$(cat /proc/banktable/booted)" == "bank_1" ] && [ ! "$(uci get -q modgui.var.check_obp)" ]; then
if [ "$(cat /proc/banktable/booted)" = "bank_1" ] && [ ! "$(uci get -q modgui.var.check_obp)" ]; then
#this set check_obp bit if not present ONLY IN BANK_1, bank_2 value is set based on bank_1 value
uci set modgui.var.check_obp="1"
fi
Expand Down

0 comments on commit b79dd45

Please sign in to comment.