-
-
Save haotian-liu/b81b89f45c90969e1359dd3cdca9f2ec to your computer and use it in GitHub Desktop.
List user-installed packages on LEDE
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 | |
FLASH_TIME="$(awk ' | |
$1 == "Installed-Time:" && ($2 < OLDEST || OLDEST=="") { | |
OLDEST=$2 | |
} | |
END { | |
print OLDEST | |
} | |
' /usr/lib/opkg/status)" | |
awk -v FT="$FLASH_TIME" ' | |
$1 == "Package:" { | |
PKG=$2 | |
USR="" | |
} | |
$1 == "Status:" && $3 ~ "user" { | |
USR=1 | |
} | |
$1 == "Installed-Time:" && USR && $2 != FT { | |
print PKG | |
} | |
' /usr/lib/opkg/status | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment