Giter Site home page Giter Site logo

opkg-upgrade's Introduction

opkg-upgrade

List and install OpenWRT / LEDE opkg upgradable packages.

Little ash app for easier opkg package upgrades.

You should check for config conflicts after upgrades!
Make sure you have enough space on root before installing stuff!
This script is small enough but SSL support for curl/wget is not!
You also need free space for downloading and installing the packages!

If you use OpenWRT trunk (dev snapshots), you should probably NOT upgrade
Upgrading development versions can soft-brick your device.
You should try to backup your config and do a full install of a later snapshot if you are running dev/trunk.
Main releases are fine (just trunk/snapshots are affected by this).
It is probably the opposite for releases (recommended to upgrade), since you will get security patches if you upgrade those.


If you want to support this project, you can do it here โ˜• ๐Ÿบ

paypal-image


Help example:

root@OpenWrt:~# opkg-upgrade --help

Simple OPKG Updater v0.4.1

Usage: opkg-upgrade [options]

Options:
  -V, --version         Show program name and version and exits
  -h, --help            Show this help screen and exits
  -i, --install [dir]   Install opkg-upgrade to [dir] or /usr/sbin
                        Leave [dir] empty for default (/usr/sbin)
  -u, --upgrade-check   Returns SUCCESS if there are updates available
                        Quiet execution, returns 0 or 1
  -l, --list-upgrades   Prints the list of available updates and exits
  -e, --email-list      Prints the list of updates in html email format
                        Includes subject, mime type and html formated data
  -s, --ssmtp <email>   Use the system's ssmtp to send update reports
                        You need to install and configure ssmtp beforehand
  -m, --msmtp <email>   Use the system's msmtp to send update reports
                        You need to install and configure msmtp beforehand
  -a, --always-send     Send e-mail even if there are no updates
                        By default e-mails are only sent when updates are available
  -t, --text-only       Send e-mail in plain text format.
                        By default, e-mails are sent in html format.
  -n, --no-opkg-update  Skip opkg update at the beginning,
                        may not find packages if not up to date
  -f, --force           Do not ask for confirmation,
                        will update everything available

Notes:
  - Short options should not be grouped. You must pass each parameter on its own.
  - You must have a working ssmtp or msmtp install to use the email functionality.
    Make sure you can send e-mails from it before trying from opkg-upgrade.

Examples:
  opkg-upgrade -n -f      # run without updating listings and asking for upgrade
  opkg-upgrade --install  # install to /usr/sbin/opkg-upgrade
  opkg-upgrade -l         # just print upgrades available
  opkg-upgrade -e         # just print html formatted email
  opkg-upgrade -s '[email protected]'    # mail upgrade report if have updates
  opkg-upgrade -a -m '[email protected]' # mail upgrade report even if NO updates
  opkg-upgrade -u && echo 'upgrades are available' || echo 'no upgrades available'

Example run:

root@OpenWrt:~# opkg-upgrade

Simple OPKG Updater v0.4.0

Done | Updating package lists
Done | Getting upgradable packages list

Packages available for upgrade: 28

+-----+----------------------------+--------------------------+--------------------------+
|   # | Package                    | Current                  | Update                   |
+-----+----------------------------+--------------------------+--------------------------+
|   1 | cgi-io                     | 2021-09-08-98cef9dd-20   | 2022-08-10-901b0f04-21   |
|   2 | curl                       | 7.82.0-2                 | 7.83.1-4.1               |
|   3 | firewall                   | 2021-03-23-61db17ed-1    | 2021-03-23-61db17ed-1.1  |
|   4 | htop                       | 3.1.2-1                  | 3.2.1-1                  |
|   5 | libcurl4                   | 7.82.0-2                 | 7.83.1-4.1               |
|   6 | libevdev                   | 1.12.0-1                 | 1.13.0-1                 |
|   7 | libiwinfo-data             | 2021-04-30-c45f0b58-2.1  | 2022-04-26-dc6847eb-1    |
|   8 | libiwinfo-lua              | 2021-04-30-c45f0b58-2.1  | 2022-04-26-dc6847eb-1    |
|   9 | libiwinfo20210430          | 2021-04-30-c45f0b58-2.1  | 2022-04-26-dc6847eb-1    |
|  10 | libudev-zero               | 1.0.0-1                  | 1.0.1-1                  |
|  11 | libustream-wolfssl20201210 | 2022-01-16-868fd881-1    | 2022-01-16-868fd881-2    |
|  12 | luci-app-ddns              | git-21.349.33342-b5a40b3 | git-22.123.50005-9139ad4 |
|  13 | luci-app-firewall          | git-22.046.85957-59c3392 | git-22.089.67741-3856d50 |
|  14 | luci-app-opkg              | git-21.312.69848-4745991 | git-22.273.29015-e01e38c |
|  15 | luci-app-statistics        | git-22.072.58464-8cac3cb | git-22.115.68435-0473e99 |
|  16 | luci-base                  | git-22.046.85957-59c3392 | git-22.304.65299-04257f6 |
|  17 | luci-lib-jsonc             | git-19.317.29469-8da8f38 | git-22.097.61937-bc85ba5 |
|  18 | luci-mod-network           | git-22.046.85061-dd54dce | git-22.244.54918-77c916e |
|  19 | luci-mod-status            | git-22.046.85784-0ac2542 | git-22.089.70019-d4f0b06 |
|  20 | luci-mod-system            | git-22.019.40321-7a37d02 | git-22.264.46189-30ba277 |
|  21 | luci-theme-bootstrap       | git-22.047.35373-cc582eb | git-22.288.45155-afd0012 |
|  22 | nano                       | 6.2-2                    | 6.4-1                    |
|  23 | px5g-wolfssl               | 3                        | 4.1                      |
|  24 | rpcd                       | 2021-03-11-ccb75178-1    | 2022-02-19-8d26a1ba-1    |
|  25 | rpcd-mod-file              | 2021-03-11-ccb75178-1    | 2022-02-19-8d26a1ba-1    |
|  26 | rpcd-mod-iwinfo            | 2021-03-11-ccb75178-1    | 2022-02-19-8d26a1ba-1    |
|  27 | usbids                     | 0.354-1                  | 0.359-1                  |
|  28 | zlib                       | 1.2.11-4                 | 1.2.11-6                 |
+-----+----------------------------+--------------------------+--------------------------+

Proceed with upgrade? (Y/y to proceed) y

.... | Upgrading packages

Upgrading cgi-io on root from 2021-09-08-98cef9dd-20 to 2022-08-10-901b0f04-21...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/cgi-io_2022-08-10-901b0f04-21_x86_64.ipk
Upgrading curl on root from 7.82.0-2 to 7.83.1-4.1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/curl_7.83.1-4.1_x86_64.ipk
Upgrading firewall on root from 2021-03-23-61db17ed-1 to 2021-03-23-61db17ed-1.1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/firewall_2021-03-23-61db17ed-1.1_x86_64.ipk
Warning: Unable to locate ipset utility, disabling ipset support
Warning: Section @zone[1] (wan) cannot resolve device of network 'wan6'
 * Flushing IPv4 filter table
 * Flushing IPv4 nat table
 * Flushing IPv4 mangle table
 * Flushing IPv6 filter table
 * Flushing IPv6 mangle table
 * Flushing conntrack table ...
Upgrading htop on root from 3.1.2-1 to 3.2.1-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/htop_3.2.1-1_x86_64.ipk
Upgrading libcurl4 on root from 7.82.0-2 to 7.83.1-4.1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/libcurl4_7.83.1-4.1_x86_64.ipk
Installing libwolfssl5.5.1.99a5b54a (5.5.1-stable-2) to root...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/libwolfssl5.5.1.99a5b54a_5.5.1-stable-2_x86_64.ipk
libwolfssl5.2.0.99a5b54a was autoinstalled and is now orphaned, removing.
Removing package libwolfssl5.2.0.99a5b54a from root...
Removing obsolete file /usr/lib/libcurl.so.4.7.0.
Upgrading libevdev on root from 1.12.0-1 to 1.13.0-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/libevdev_1.13.0-1_x86_64.ipk
Upgrading libiwinfo-data on root from 2021-04-30-c45f0b58-2.1 to 2022-04-26-dc6847eb-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/libiwinfo-data_2022-04-26-dc6847eb-1_x86_64.ipk
Upgrading libiwinfo-lua on root from 2021-04-30-c45f0b58-2.1 to 2022-04-26-dc6847eb-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/libiwinfo-lua_2022-04-26-dc6847eb-1_x86_64.ipk
Upgrading libiwinfo20210430 on root from 2021-04-30-c45f0b58-2.1 to 2022-04-26-dc6847eb-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/libiwinfo20210430_2022-04-26-dc6847eb-1_x86_64.ipk
Upgrading libudev-zero on root from 1.0.0-1 to 1.0.1-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/libudev-zero_1.0.1-1_x86_64.ipk
Upgrading libustream-wolfssl20201210 on root from 2022-01-16-868fd881-1 to 2022-01-16-868fd881-2...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/libustream-wolfssl20201210_2022-01-16-868fd881-2_x86_64.ipk
Upgrading luci-app-ddns on root from git-21.349.33342-b5a40b3 to git-22.123.50005-9139ad4...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-app-ddns_git-22.123.50005-9139ad4_all.ipk
Upgrading luci-app-firewall on root from git-22.046.85957-59c3392 to git-22.089.67741-3856d50...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-app-firewall_git-22.089.67741-3856d50_all.ipk
Upgrading luci-app-opkg on root from git-21.312.69848-4745991 to git-22.273.29015-e01e38c...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-app-opkg_git-22.273.29015-e01e38c_all.ipk
Upgrading luci-app-statistics on root from git-22.072.58464-8cac3cb to git-22.115.68435-0473e99...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-app-statistics_git-22.115.68435-0473e99_all.ipk
Upgrading luci-base on root from git-22.046.85957-59c3392 to git-22.304.65299-04257f6...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-base_git-22.304.65299-04257f6_x86_64.ipk
Upgrading luci-lib-jsonc on root from git-19.317.29469-8da8f38 to git-22.097.61937-bc85ba5...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-lib-jsonc_git-22.097.61937-bc85ba5_x86_64.ipk
Upgrading luci-mod-network on root from git-22.046.85061-dd54dce to git-22.244.54918-77c916e...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-mod-network_git-22.244.54918-77c916e_all.ipk
Upgrading luci-mod-status on root from git-22.046.85784-0ac2542 to git-22.089.70019-d4f0b06...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-mod-status_git-22.089.70019-d4f0b06_x86_64.ipk
Upgrading luci-mod-system on root from git-22.019.40321-7a37d02 to git-22.264.46189-30ba277...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-mod-system_git-22.264.46189-30ba277_all.ipk
Upgrading luci-theme-bootstrap on root from git-22.047.35373-cc582eb to git-22.288.45155-afd0012...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/luci/luci-theme-bootstrap_git-22.288.45155-afd0012_all.ipk
Upgrading nano on root from 6.2-2 to 6.4-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/nano_6.4-1_x86_64.ipk
Upgrading px5g-wolfssl on root from 3 to 4.1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/px5g-wolfssl_4.1_x86_64.ipk
libwolfssl5.1.1.99a5b54a was autoinstalled and is now orphaned, removing.
Removing package libwolfssl5.1.1.99a5b54a from root...
Upgrading rpcd on root from 2021-03-11-ccb75178-1 to 2022-02-19-8d26a1ba-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/rpcd_2022-02-19-8d26a1ba-1_x86_64.ipk
Upgrading rpcd-mod-file on root from 2021-03-11-ccb75178-1 to 2022-02-19-8d26a1ba-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/rpcd-mod-file_2022-02-19-8d26a1ba-1_x86_64.ipk
Upgrading rpcd-mod-iwinfo on root from 2021-03-11-ccb75178-1 to 2022-02-19-8d26a1ba-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/rpcd-mod-iwinfo_2022-02-19-8d26a1ba-1_x86_64.ipk
Upgrading usbids on root from 0.354-1 to 0.359-1...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/packages/usbids_0.359-1_x86_64.ipk
Upgrading zlib on root from 1.2.11-4 to 1.2.11-6...
Downloading https://downloads.openwrt.org/releases/21.02.2/packages/x86_64/base/zlib_1.2.11-6_x86_64.ipk
Configuring rpcd.
Configuring luci-lib-jsonc.
Configuring rpcd-mod-file.
Configuring cgi-io.
Configuring luci-base.
Configuring zlib.
Configuring libiwinfo-data.
Configuring libiwinfo20210430.
Configuring luci-app-statistics.
Configuring libevdev.
Configuring luci-app-opkg.
Configuring nano.
Configuring libiwinfo-lua.
Configuring luci-mod-system.
Configuring libwolfssl5.5.1.99a5b54a.
Configuring libustream-wolfssl20201210.
Configuring luci-theme-bootstrap.
/luci-static/bootstrap
/luci-static/bootstrap-dark
/luci-static/bootstrap-light
Configuring libudev-zero.
Configuring usbids.
Configuring px5g-wolfssl.
Configuring luci-mod-status.
Configuring rpcd-mod-iwinfo.
Configuring luci-mod-network.
Configuring luci-app-ddns.
Configuring firewall.
Warning: Unable to locate ipset utility, disabling ipset support
Warning: Section @zone[1] (wan) cannot resolve device of network 'wan6'
 * Populating IPv4 filter table
   * Rule 'Allow-DHCP-Renew'
   * Rule 'Allow-Ping'
   * Rule 'Allow-IGMP'
   * Rule 'Allow-IPSec-ESP'
   * Rule 'Allow-ISAKMP'
   * Forward 'lan' -> 'wan'
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv4 nat table
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv4 mangle table
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv6 filter table
   * Rule 'Allow-DHCPv6'
   * Rule 'Allow-MLD'
   * Rule 'Allow-ICMPv6-Input'
   * Rule 'Allow-ICMPv6-Forward'
   * Rule 'Allow-IPSec-ESP'
   * Rule 'Allow-ISAKMP'
   * Forward 'lan' -> 'wan'
   * Zone 'lan'
   * Zone 'wan'
 * Populating IPv6 mangle table
   * Zone 'lan'
   * Zone 'wan'
 * Flushing conntrack table ...
 * Set tcp_ecn to off
 * Set tcp_syncookies to on
 * Set tcp_window_scaling to on
 * Running script '/etc/firewall.user'
Configuring luci-app-firewall.
Configuring libcurl4.
Configuring curl.
Configuring htop.
Collected errors:
 * resolve_conffiles: Existing conffile /etc/config/luci is different from the conffile in the new package. The new conffile will be placed at /etc/config/luci-opkg.
 * resolve_conffiles: Existing conffile /etc/config/ucitrack is different from the conffile in the new package. The new conffile will be placed at /etc/config/ucitrack-opkg.
Done |
Upgrade finished

Please check for config file conflicts!

When all up-to-date:

# ./opkg-upgrade.sh -f -n

Simple OPKG Updater v0.4.0

Done | Ignoring package lists update
Done | Getting upgradable packages list

No packages to install!

Install using git:

Clone it in current directory and use the -i option to install it to /usr/sbin/opkg-upgrade

# git clone git://github.com/tavinus/opkg-upgrade.git
# cd opkg-upgrade
# ./opkg-upgrade.sh -i

Install using curl or wget:

NOTE: curl / wget may fail because of missing SSL certificates.

You may choose to ignore the certificates check using:

  • curl -k
  • wget --no-check-certificate

Or you will need to fix your /etc/ssl/certs/ca-certificates.crt installation.
Please note that SSL support takes quite a lot of storage space.

This should be enough to make SSL work:

opkg install ca-certificates openssl-util

And this may be a workaround if you still have problems:

mkdir -p -m0755 /etc/ssl/certs && curl -k -o /etc/ssl/certs/ca-certificates.crt -L http://curl.haxx.se/ca/cacert.pem

Relevant links:

Oneliners to run from internet ( downloads to /tmp ) :

# using wget with SSL
wget 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "/tmp/opkg-upgrade.sh" && chmod 755 "/tmp/opkg-upgrade.sh" && /tmp/opkg-upgrade.sh

# using wget WITHOUT SSL
wget --no-check-certificate 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "/tmp/opkg-upgrade.sh" && chmod 755 "/tmp/opkg-upgrade.sh" && /tmp/opkg-upgrade.sh

# using curl with SSL
curl -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "/tmp/opkg-upgrade.sh" && chmod 755 "/tmp/opkg-upgrade.sh" && /tmp/opkg-upgrade.sh

# using curl WITHOUT SSL
curl -k -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "/tmp/opkg-upgrade.sh" && chmod 755 "/tmp/opkg-upgrade.sh" && /tmp/opkg-upgrade.sh

Local install to current dir ( ./opkg-upgrade.sh ) :

Run with ./opkg-upgrade.sh after downloading

# using wget with SSL
wget 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

# using wget WITHOUT SSL
wget --no-check-certificate 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

# using curl with SSL
curl -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

# using curl WITHOUT SSL
curl -k -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "opkg-upgrade.sh" && chmod 755 "opkg-upgrade.sh"

System install to /usr/sbin/opkg-upgrade (no .sh extension) :

Run with opkg-upgrade after downloading

# using wget with SSL
wget 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

# using wget WITHOUT SSL
wget --no-check-certificate 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -O "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

# using curl with SSL
curl -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

# using curl WITHOUT SSL
curl -k -L 'https://raw.githubusercontent.com/tavinus/opkg-upgrade/master/opkg-upgrade.sh' -o "/usr/sbin/opkg-upgrade" && chmod 755 "/usr/sbin/opkg-upgrade"

opkg-upgrade's People

Contributors

lareq avatar nmasse-itix avatar tavinus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opkg-upgrade's Issues

Optional removal of *-opkg from /etc/config after upgrade

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

[Contribution] How to run from Luci

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

Blacklist packages

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:

  • Can we blacklist from opkg itself?
  • Can we blacklist on repository configuration?
  • Does opkg has any kind of pinning?
  • Should we save the information of blacklisted packages on a file? Where?
  • Should we just have a parameter to ignore packages on the fly?

Wish List - 2019/2020/2021/2022/2023

Already Implemented

v0.3.2 :

  • Sort package list by package names
  • Ignore opkg warnings
    • 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.
    • It was kind of rare though. I THINK it only happens on TRUNK/BETA versions that are very old.
  • Use awk + printf to print an ASCII table of the updates (prettier)

v0.3.4 :

  • Load info from /etc/openwrt_release when available
  • Add more router info on email report (from openwrt_release)
  • Detect if the system is a DISTRIB_RELEASE='SNAPSHOT' and show warning about upgrading those
  • New/prettier HTML email (new font type, sizes and info table)

Pending

  • Colorized output (must be optional)
  • Implement Self-Update parameter/functionality (to upgrade from github master)
  • Implement tests (travis-ci maybe?)
  • Option to select / choose which updates to apply
    • Very cool idea but adds a lot on complexity / parsing, may be postponed
    • Already have a numbered list that can be used
  • Wiki Content
    • Troubleshooting
      • The squashfs "problem" (read only, uses new space)
      • The SNAPSHOT "problem" (why those should not be upgraded)
    • Install / Download
    • Self-Update
    • Basic Usage / Examples
    • Emailing reports (ssmtp and others)
    • Dealing with config file conflicts
  • Tools to compare / diff config files conflicts
    • Should try to detect /etc/config/*-opkg files (or get from installer message)
    • Use diff or git diff to offer comparison (if available)
    • File Operations for conf files
      • Remove
      • Move
      • Edit / Merge

tav

Just thought I would let you know your script still works OpenWRT 19.07.0 first release candidate

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`

Love this script - cron+email

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.

Script ends with cancelled by user

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:~#

Incorrect statement when no packages need updates

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?

Integrating opkg-upgrade in .profile - how to use background checking for new packages

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.