fixed references to scripts directory and added linux package lister command.
[feisty_meow.git] / scripts / system / list_packages.sh
diff --git a/scripts/system/list_packages.sh b/scripts/system/list_packages.sh
new file mode 100644 (file)
index 0000000..6b3222f
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
+
+if debian_like; then
+  dpkg -la | grep $*
+  exit $?
+fi
+
+rpm_available="$(which rpm)"
+if [ ! -z "$rpm_available" ]; then
+#is that the right phrase for rpm?  somewhat forgotten.
+  rpm -qa | grep $*
+  exit $?
+fi
+
+yum_available="$(which yum)"
+if [ ! -z "$yum_available" ]; then
+  yum list | grep $*
+  exit $?
+fi
+
+echo "Could not deduce what type of OS this is; missing package listing commands."
+exit 1