OpenWrt does not have bash by default. The following commands are in pure busybox.
- Get installed packages by calling opkg list_installed
- Remove everything after ‘ – ‘ with sed
- Add opkg upgrade at the beginning of each line
- Finally we evaluate the sed output with eval
Full command:
# eval $(opkg list_installed | sed 's/ - .*//' | sed 's/^/opkg upgrade /')