tavinus / opkg-upgrade Goto Github PK
View Code? Open in Web Editor NEWList and install OpenWRT / LEDE opkg upgradable packages
List and install OpenWRT / LEDE opkg upgradable packages
Hello,
your program offers email notification using opkg-upgrade -s '[email protected]'
.
However ssmtp is no longer available on OpenWrt 21.02 and later.
For details please check OpenWrt documentation.
Can you please adapt your program to work with mailsend
?
THX
When there's no package to be updated, the software should say so, instead of this:
Simple OPKG Updater v0.3.0
Done | Updating package lists
Error when trying list upgradable packages. Permissions?
Nice to have:
A) Ask the user if he/she would like to remove all default configuration files that opkg places in /etc/config ( /etc/config/*-opkg )
B) If so, delete them
Another approach would be to move them out to another directory
At program initialization, it should check if there's a newer version of itself, and if so, offer the user to upgrade ( Using wget without ssl if available )
Could you package this and submit it as a pull request to openwrt? https://github.com/openwrt/openwrt/pulls
It would be really great to be able to run opkg install opkg-upgrade
๐
Masterful work. I wonder if it is possible to have it email you when there are updates. For example say I set a cron job to check for updates every Friday. Instead of sshing into the box and running your script manually, it could email me the list of update-able packages.
opkg list-upgradable
may print something like "Multiple packages (libpthread and libpthread) providing same name marked HOLD or PREFER. Using latest."
within the list. This used to cause an error because it would be parsed as a package name.awk + printf
to print an ASCII table of the updates (prettier)/etc/openwrt_release
when availableDISTRIB_RELEASE='SNAPSHOT'
and show warning about upgrading thoseSelf-Update
parameter/functionality (to upgrade from github master)squashfs
"problem" (read only, uses new space)SNAPSHOT
"problem" (why those should not be upgraded)/etc/config/*-opkg
files (or get from installer message)diff
or git diff
to offer comparison (if available)tav
Hello,
I have integrated opkg-upgrade
in .profile, means I get this when starting a shell-session as root:
thomas@eddie:~$ sudo su -
BusyBox v1.33.2 (2022-04-16 12:59:34 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 21.02.3, r16554-1d4dea6d4f
-----------------------------------------------------
My current WAN IP is: xxx.xxx.xxx.xxx
Software status report:
--> No upgrades available.
This is implemented with the following coding in .profile:
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo "Software status report:"
opkg-upgrade -u \
&& echo -e "${YELLOW}--> Upgrades are available.${NC}\n----> List available upgrades: opkg-upgrade -l\n----> Upgrade packages: opkg-upgrade\n" \
|| echo -e "${GREEN}--> No upgrades available.${NC}\n"
The downside of this implementation is that I have to wait several seconds until the command prompt is ready.
Question:
Can I check for new packages in the background (regularely) and then fetch the results only w/o waiting for command opkg-upgrade -u
to return data?
THX
Here is an easier way to run this command without the need to use Putty and SSH.
0- install the shell command according to the tutorial and take not of where it was saved (you can lookup for it using WinSCP)
1- install (luci-app-commands)
2- refresh your browser page (F5)
3- on LUCI top menu find ( System \ Custom Commands
4 - select Configuration tab
5- click add button
6- insert a relevant description (example: opkg-upgrade)
7- on command field insert the path to the script (with the command name and taking care of the extension existence or not) [example: /usr/sbin/opkg-upgrade -f] Note: add -f or --force to make it do the upgrade without the need to add the Custom arguments yourself, optionally you can check the Custom arguments if you want this to be more flexible and allows you to adjust the execution to your actual need.
I hope this help
Got a donation asking to be able to blacklist packages.
Seems like a nice addition to avoid problematic packages that should not be upgraded.
Need more research on some things:
I tried your script but it does not ask me if I want to install updates it just say's cancelled by user, Any guidence would be appreciated.
This is the command I used:
curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh | sh
A little bit about my install and my router:
LEDE/OpenWRT
Model | TP-Link TL-WDR4300 v1
Firmware Version | LEDE Reboot 17.01.2 r3435-65eec8bd5f / LuCI lede-17.01 branch (git-17.152.82987-7f6fc16)
Kernel Version | 4.4.71
Running your script using curl:
root@LEDE:~# curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh | sh
Simple OPKG Updater v0.2.3
Done | Updating package lists
Done | Getting upgradable packages list
Packages available for upgrade: 13
luci-lib-ip - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-theme-bootstrap - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
dnsmasq - 2.77-1 - 2.77-2
luci-app-firewall - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
odhcp6c - 2017-01-30-c13b6a05-1 - 2017-01-30-c13b6a05-2
dropbear - 2017.75-1 - 2017.75-2
luci-proto-ppp - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-mod-admin-full - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-base - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-proto-ipv6 - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-lib-nixio - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci-lib-jsonc - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
luci - git-17.152.82987-7f6fc16-1 - git-17.194.52964-580f012-1
Cancelled by user!
root@LEDE:~#
Just thought I would let you know your script still works OpenWRT 19.07.0 first release candidate
# curl -k -sSL https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh -o ./opkg-upgrade.sh && chmod +x ./opkg-upgrade.sh && ./opkg-upgrade.sh
Simple OPKG Updater v0.3.5
Done | Updating package lists
Done | Getting upgradable packages list
Packages available for upgrade: 18
+-----+----------------------+----------------------------+----------------------------+
| # | Package | Current | Update |
+-----+----------------------+----------------------------+----------------------------+
| 1 | luci | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 2 | luci-app-firewall | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 3 | luci-app-opkg | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 4 | luci-app-travelmate | git-19.310.44720-c2be304-1 | git-19.312.54336-a987e21-1 |
| 5 | luci-base | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 6 | luci-compat | git-19.310.44720-c2be304-1 | git-19.312.54336-a987e21-1 |
| 7 | luci-lib-ip | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 8 | luci-lib-jsonc | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 9 | luci-lib-nixio | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 10 | luci-mod-admin-full | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 11 | luci-mod-network | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 12 | luci-mod-status | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 13 | luci-mod-system | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 14 | luci-proto-ipv6 | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 15 | luci-proto-ppp | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 16 | luci-proto-relay | git-19.310.44720-c2be304-1 | git-19.312.54336-a987e21-1 |
| 17 | luci-theme-bootstrap | git-19.309.76540-c0e73d3-1 | git-19.312.54336-a987e21-1 |
| 18 | rpcd-mod-luci | 20191103 | 20191108 |
+-----+----------------------+----------------------------+----------------------------+
Proceed with upgrade? (Y/y to proceed) y
.... | Upgrading packages`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.