Skip to content

Instantly share code, notes, and snippets.

@ejona86
Created October 21, 2017 16:35
Show Gist options
  • Save ejona86/26974041ebbb3bf6602bd1bee0f92860 to your computer and use it in GitHub Desktop.
Save ejona86/26974041ebbb3bf6602bd1bee0f92860 to your computer and use it in GitHub Desktop.
List user-installed packages on LEDE
#!/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