Created
August 5, 2024 04:37
-
-
Save omalley/a097b8f999b9661126ec84db3bf9d3c2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Get the initial install time | |
FLASH_TIME=$(opkg info busybox | grep '^Installed-Time: '| cut -d' ' -f2) | |
# For each installed package | |
# if it was installed by the user | |
# and it was installed after the flash_time | |
# and it isn't a dependency, print it out | |
opkg list-installed | cut -d' ' -f1 | xargs -n 1 opkg info | \ | |
awk -F: '/Package:/ {pkg = $2; gsub(" ","", pkg)} /Depends:/ {split($2,parts,", "); for (i in parts) {split(parts[i], words, " "); dep[words[1]] = 1}} /Status:/ {status = $2} /Installed-Time:/ {if ($2 > '"$FLASH_TIME"' && status == " install user installed") {pkglist[pkgcnt++] = pkg}} END {for (i in pkglist) {pkg = pkglist[i]; if (!(pkg in dep)) {print pkglist[i]}}}' | \ | |
sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The script takes a couple of minutes to run on my router.