summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-opkg/root/usr/libexec/opkg-list
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-opkg/root/usr/libexec/opkg-list')
-rwxr-xr-xapplications/luci-app-opkg/root/usr/libexec/opkg-list15
1 files changed, 15 insertions, 0 deletions
diff --git a/applications/luci-app-opkg/root/usr/libexec/opkg-list b/applications/luci-app-opkg/root/usr/libexec/opkg-list
new file mode 100755
index 000000000..088bc6339
--- /dev/null
+++ b/applications/luci-app-opkg/root/usr/libexec/opkg-list
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+case "$1" in
+ installed)
+ cat /usr/lib/opkg/status
+ ;;
+ available)
+ lists_dir=$(sed -rne 's#^lists_dir \S+ (\S+)#\1#p' /etc/opkg.conf /etc/opkg/*.conf 2>/dev/null | tail -n 1)
+ find "${lists_dir:-/tmp/opkg-lists}" -type f '!' -name '*.sig' | xargs -r gzip -cd
+ ;;
+ *)
+ echo "Usage: $0 {installed|available}" >&2
+ exit 1
+ ;;
+esac