Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save haotian-liu/b81b89f45c90969e1359dd3cdca9f2ec to your computer and use it in GitHub Desktop.
Save haotian-liu/b81b89f45c90969e1359dd3cdca9f2ec 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