I did this but no luck. Would you be willing share your font type and size settings? I am still on UTF-8. Not sure why I can't get this to work right.
Thank you!
I'm going to have to sleep on this one and approach it on a clear head , makes no logical sense to me why its failing to use the entware binaries from all the information you both provided.
Thanks for the information, sorry I couldn't provide a solution just yet beyond downgrade and wait for a firmware update to natively correct the issue.
if [ "$(/usr/sbin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
if [ -f "/opt/bin/opkg" ] && [ ! -f "/opt/bin/curl" ]; then
opkg update
opkg install curl
elif [ "$(/opt/bin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
opkg update
opkg upgrade curl
elif [ ! -f "/opt/bin/opkg" ]; then
logger -st Skynet "[!] curl Version Outdated - Please Update Firmware Or Install Entware"
fi
else
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
fi
Why is $PATH being re-written in the last else -- fi? Won't that give precedence to the /sbin version of curl if the script is run a *second* time, un-doing the opkg install of curl to /opt/bin?
if [ "$(/usr/sbin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
if [ -f "/opt/bin/opkg" ] && [ ! -f "/opt/bin/curl" ]; then
opkg update
opkg install curl
elif [ "$(/opt/bin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
opkg update
opkg upgrade curl
elif [ ! -f "/opt/bin/opkg" ]; then
logger -st Skynet "[!] curl Version Outdated - Please Update Firmware Or Install Entware"
fi
else
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
fi
Why is $PATH being re-written in the last else -- fi? Won't that give precedence to the /sbin version of curl if the script is run a *second* time, un-doing the opkg install of curl to /opt/bin?
It checks the version of the read-only curl in firmware. If it’s new enough, it prioritizes the firmware version. Otherwise it leaves the PATH untouched assuming Entware version will be first in the path. The /usr/sbin/curl version won’t change without a firmware upgrade.
Why is $PATH being re-written in the last else -- fi? Won't that give precedence to the /sbin version of curl if the script is run a *second* time, un-doing the opkg install of curl to /opt/bin?
Yes, but once the script has installed the new curl in /opt/bin on the first pass (when everything will work), the *NEXT TIME* the script is run, it will go to the else statement, which rewrites $PATH to put sbin upfront.
The opkg installation changes $PATH so /opt/bin is at the front, as shown in /opt/etc/profile. The statement on the last else -- fi undoes this, if the script is run again.
Yes, but once the script has installed the new curl in /opt/bin on the first pass (when everything will work), the *NEXT TIME* the script is run, it will go to the else statement, which rewrites $PATH to put sbin upfront.
Thats why we specifically check "/usr/sbin/curl --version" rather then plain old "curl --version" which as you stated would prioritize entware on the second run.
We added the path var around two years ago because I vaguely remember a specific stripped down busybox binary acting differently then the full entware version (git history shows it may have been the find binary), it also makes development easier so I don't accidentally use non supported flags. Not something I want to remove without further investigation as it may cause other issues.
Still very confusing why the fix is working for some but not others
I'm going to have to sleep on this one and approach it on a clear head , makes no logical sense to me why its failing to use the entware binaries from all the information you both provided.
Thanks for the information, sorry I couldn't provide a solution just yet beyond downgrade and wait for a firmware update to natively correct the issue.
if [ "$(/usr/sbin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
if [ -f "/opt/bin/opkg" ] && [ ! -f "/opt/bin/curl" ]; then
opkg update
opkg install curl
elif [ "$(/opt/bin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
opkg update
opkg upgrade curl
elif [ ! -f "/opt/bin/opkg" ]; then
logger -st Skynet "[!] curl Version Outdated - Please Update Firmware Or Install Entware"
fi
else
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
fi
This seems to work for everyone except @Zastoff and (prior to upgrading)@Andy1932 . For those two regardless of what we tried the built-in curl binary was always being prioritized regardless of their path vars. Very confusing.
Barring any PATH statements in /jffs/configs/profile.add.
Always hard troubleshooting someone else’s router.
I still don’t like something about why it would work for @Zastoff when he would put the absolute path to Entware (/tmp/mnt/.../bin). I must learn to let go.
Tested again with 7.0.2 and still got the "Consolidating Blacklist | curl: option -fsLZ: is unknown" on Malware Blacklist update
Tested again with adding my export PATH=.. but after all the entware checking
if [ "$(/usr/sbin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
if [ -f "/opt/bin/opkg" ] && [ ! -f "/opt/bin/curl" ]; then
opkg update
opkg install curl
elif [ "$(/opt/bin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
opkg update
opkg upgrade curl
elif [ ! -f "/opt/bin/opkg" ]; then
logger -st Skynet "[!] curl Version Outdated - Please Update Firmware Or Install Entware"
fi
else
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
fi
export PATH=/tmp/mnt/Zastoff/entware/bin:/sbin:/bin:/usr/sbin:/usr/bin:$PATH
printf '\033[?7l'
And now Malware Blacklist update works!! And i read your posts and started thinking.. i use a older netflix script did a check in IPSET_Netflix.sh and there is some entware checking in that script, Can that be my problem?
Added echo $PATH to script
Checked with my export PATH
and get:
/tmp/mnt/Zastoff/entware/bin:/sbin:/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/home/drizzt:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
Removed my export PATH
and get:
/sbin:/bin:/usr/sbin:/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/home/drizzt:/mmc/sbin:/mmc/bin:/mmc/usr/sbin:/mmc/usr/bin:/opt/sbin:/opt/bin:/opt/usr/sbin:/opt/usr/bin
So it would appear that the initial version check is indeed failing for some reason, and the subsequent export path statement is pushing the /usr/sbin version over /opt/bin.
Could you see if adding an export path with /opt/bin first instead of your /tmp/mnt/Zastoff.. works?
So it would appear that the initial version check is indeed failing for some reason, and the subsequent export path statement is pushing the /usr/sbin version over /opt/bin.
Could you see if adding an export path with /opt/bin first instead of your /tmp/mnt/Zastoff.. works?
Tested again with 7.0.2 and still got the "Consolidating Blacklist | curl: option -fsLZ: is unknown" on Malware Blacklist update
Tested again with adding my export PATH=.. but after all the entware checking
if [ "$(/usr/sbin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
if [ -f "/opt/bin/opkg" ] && [ ! -f "/opt/bin/curl" ]; then
opkg update
opkg install curl
elif [ "$(/opt/bin/curl --version | awk 'NR >= 1 && NR <= 1 {print $2}' | tr -d '.')" -lt "7660" ]; then
opkg update
opkg upgrade curl
elif [ ! -f "/opt/bin/opkg" ]; then
logger -st Skynet "[!] curl Version Outdated - Please Update Firmware Or Install Entware"
fi
else
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:$PATH
fi
export PATH=/tmp/mnt/Zastoff/entware/bin:/sbin:/bin:/usr/sbin:/usr/bin:$PATH
printf '\033[?7l'
And now Malware Blacklist update works!! And i read your posts and started thinking.. i use a older netflix script did a check in IPSET_Netflix.sh and there is some entware checking in that script, Can that be my problem?