Created
August 18, 2019 23:36
-
-
Save denpamusic/c75b039deed76f29d807cf936bfba547 to your computer and use it in GitHub Desktop.
Aliases to commonly used package management tasks for OpenWRT
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# /etc/profile.d/opkg.sh | |
# 'opkg-upgrade' - tries to upgrade every package to the latest version. | |
alias opkg-upgrade='opkg update; echo; u=$(opkg list-upgradable); [ "x${u}" != "x" ] && (opkg install netifd; echo "${u}" | cut -f1 -d" " | xargs opkg upgrade) || echo Nothing to upgrade.' | |
# 'opkg-save' - saves list of installed packages to /etc/installed-packages.list, | |
# which can then be use to reinstall packages with 'opkg-restore'. | |
# Useful after sysupgrade. | |
alias opkg-save='opkg list-installed | cut -f1 -d" " > /etc/installed-packages.list' | |
# 'opkg-restore' - reinstall packages saved by 'opkg-save'. | |
alias opkg-restore='[ -f "/etc/installed-packages.list" ] && opkg update && while read -r pkg; do opkg install "${pkg}"; done < /etc/installed-packages.list' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment