diff --git a/dot_bashrc.d/executable_09.functions.tmpl b/dot_bashrc.d/executable_09.functions.tmpl index 4d73794..5b3fba7 100755 --- a/dot_bashrc.d/executable_09.functions.tmpl +++ b/dot_bashrc.d/executable_09.functions.tmpl @@ -113,19 +113,27 @@ list-ssh-keys() { done } -{{- if (or (eq .chezmoi.osRelease.id "debian") (eq .chezmoi.osRelease.id "linuxmint") (eq .chezmoi.osRelease.id "ubuntu")) }} # Show version of a Debian package debversion() { - local pkgname="${1:?packagename required}" - dpkg -s $pkgname | grep Version + if [ -x dpkg ]; then + local pkgname="${1:?packagename required}" + dpkg -s $pkgname | grep Version + else + echo "not a Debian based system!" + return 42 + fi } # Show files of a Debian package deblist() { - local pkgname="${1:?packagenamme required}" - dpkg-query -L $pkgname + if [ -x dpkg ]; then + local pkgname="${1:?packagenamme required}" + dpkg-query -L $pkgname + else + echo "not a Debian based system!" + return 42 + fi } -{{- end }} # Run 'top' by a list of processes matching name. topby() {